Environment
Overview
Provides information about the current environment and platform.
Use the Environment class to retrieve information such as environment variable or operating system version.
Note: this class is heavily related to a current platform, some of methods may not be available for all environments.
Location
- Reference: Sugar
- Namespace: Sugar
ApplicationContext
Android only. Global information about an application environment. This property is required for some classes (Folder, UserSettings) on the Anroid platform.
class property ApplicationContext: Object read write;
class Object ApplicationContext { get; set; }
static var ApplicationContext: Object { get{} set{} }
class Object ApplicationContext { __get; __set; }
Shared Property ApplicationContext() As Object
CompilerMode
class property CompilerMode: CompilerMode read;
class CompilerMode CompilerMode { get; }
static var CompilerMode: CompilerMode { get{} }
class CompilerMode CompilerMode { __get; }
Shared ReadOnly Property CompilerMode() As CompilerMode
CompilerSubMode
class property CompilerSubMode: CompilerSubMode read;
class CompilerSubMode CompilerSubMode { get; }
static var CompilerSubMode: CompilerSubMode { get{} }
class CompilerSubMode CompilerSubMode { __get; }
Shared ReadOnly Property CompilerSubMode() As CompilerSubMode
CurrentDirectory
class method CurrentDirectory: String
static String CurrentDirectory()
static func CurrentDirectory() -> String
static String CurrentDirectory()
Shared Function CurrentDirectory() As String
GetEnvironmentVariable
Retrieves the value of an environment variable from the current process.
Parameters:
- Name: The name of the environment variable.
NewLine
Gets the newline string defined for this environment.
class property NewLine: String read;
class String NewLine { get; }
static var NewLine: String { get{} }
class String NewLine { __get; }
Shared ReadOnly Property NewLine() As String
OS
class property OS: OperatingSystem read;
class OperatingSystem OS { get; }
static var OS: OperatingSystem { get{} }
class OperatingSystem OS { __get; }
Shared ReadOnly Property OS() As OperatingSystem
OSName
Gets a string that contains the current platform name.
class property OSName: String read;
class String OSName { get; }
static var OSName: String { get{} }
class String OSName { __get; }
Shared ReadOnly Property OSName() As String
OSVersion
Gets a string that contains the current platform version number.
class property OSVersion: String read;
class String OSVersion { get; }
static var OSVersion: String { get{} }
class String OSVersion { __get; }
Shared ReadOnly Property OSVersion() As String
TargetPlatform
Gets a value that indicates active platfrom.
class property TargetPlatform: TargetPlatform read;
class TargetPlatform TargetPlatform { get; }
static var TargetPlatform: TargetPlatform { get{} }
class TargetPlatform TargetPlatform { __get; }
Shared ReadOnly Property TargetPlatform() As TargetPlatform
TargetPlatformName
Gets a string that contains current platform name.
class property TargetPlatformName: String read;
class String TargetPlatformName { get; }
static var TargetPlatformName: String { get{} }
class String TargetPlatformName { __get; }
Shared ReadOnly Property TargetPlatformName() As String
UserName
Gets the user name of currently active or device owner user.
ApplicationContext
Android only. Global information about an application environment. This property is required for some classes (Folder, UserSettings) on the Anroid platform.
class property ApplicationContext: Object read write;
class Object ApplicationContext { get; set; }
static var ApplicationContext: Object { get{} set{} }
class Object ApplicationContext { __get; __set; }
Shared Property ApplicationContext() As Object
CompilerMode
class property CompilerMode: CompilerMode read;
class CompilerMode CompilerMode { get; }
static var CompilerMode: CompilerMode { get{} }
class CompilerMode CompilerMode { __get; }
Shared ReadOnly Property CompilerMode() As CompilerMode
CompilerSubMode
class property CompilerSubMode: CompilerSubMode read;
class CompilerSubMode CompilerSubMode { get; }
static var CompilerSubMode: CompilerSubMode { get{} }
class CompilerSubMode CompilerSubMode { __get; }
Shared ReadOnly Property CompilerSubMode() As CompilerSubMode
NewLine
Gets the newline string defined for this environment.
class property NewLine: String read;
class String NewLine { get; }
static var NewLine: String { get{} }
class String NewLine { __get; }
Shared ReadOnly Property NewLine() As String
OS
class property OS: OperatingSystem read;
class OperatingSystem OS { get; }
static var OS: OperatingSystem { get{} }
class OperatingSystem OS { __get; }
Shared ReadOnly Property OS() As OperatingSystem
OSName
Gets a string that contains the current platform name.
class property OSName: String read;
class String OSName { get; }
static var OSName: String { get{} }
class String OSName { __get; }
Shared ReadOnly Property OSName() As String
OSVersion
Gets a string that contains the current platform version number.
class property OSVersion: String read;
class String OSVersion { get; }
static var OSVersion: String { get{} }
class String OSVersion { __get; }
Shared ReadOnly Property OSVersion() As String
TargetPlatform
Gets a value that indicates active platfrom.
class property TargetPlatform: TargetPlatform read;
class TargetPlatform TargetPlatform { get; }
static var TargetPlatform: TargetPlatform { get{} }
class TargetPlatform TargetPlatform { __get; }
Shared ReadOnly Property TargetPlatform() As TargetPlatform
TargetPlatformName
Gets a string that contains current platform name.
class property TargetPlatformName: String read;
class String TargetPlatformName { get; }
static var TargetPlatformName: String { get{} }
class String TargetPlatformName { __get; }
Shared ReadOnly Property TargetPlatformName() As String
UserName
Gets the user name of currently active or device owner user.
CurrentDirectory
class method CurrentDirectory: String
static String CurrentDirectory()
static func CurrentDirectory() -> String
static String CurrentDirectory()
Shared Function CurrentDirectory() As String
GetEnvironmentVariable
Retrieves the value of an environment variable from the current process.
Parameters:
- Name: The name of the environment variable.