File: app.go

package info (click to toggle)
golang-github-apparentlymart-go-userdirs 0.0~git20200915.b0c018a-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 184 kB
  • sloc: makefile: 2
file content (32 lines) | stat: -rw-r--r-- 1,354 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package userdirs

// ForApp returns a set of user-specific directories for a particular
// application.
//
// The three arguments are used in different ways depending on the current
// host operating system, because each OS has different conventions.
//
//    - On Windows, the vendor and string are used to construct a two-level
//      heirarchy, vendor/name, under each namespaced directory prefix.
//      The bundleID is ignored.
//    - On Linux and other similar Unix systems, the name is converted to
//      lowercase and any spaces changed to dashes and used as a subdirectory
//      name. The vendor and bundleID are ignored.
//    - On Mac OS X, the bundleID is used and the name and vendor are ignored.
//
// For best results, the name and vendor arguments should contain
// space-separated words using title case, like "Image Editor" and "Contoso",
// and the bundleID should be a reverse-DNS-style string, like
// "com.example.appname".
func ForApp(name string, vendor string, bundleID string) Dirs {
	// Delegate to OS-specific implementation
	return forApp(name, vendor, bundleID)
}

// SupportedOS returns true if the current operating system is supported by
// this package. If this function returns false, any call to ForApp will
// panic.
func SupportedOS() bool {
	// Delegate to OS-specific implementation
	return supportedOS()
}