![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * M i s c e l l a n e o u s S y s t e m F u n c t i o n s * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2005,2009 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU Lesser General Public License as published by * 00010 * the Free Software Foundation; either version 3 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public License * 00019 * along with this program. If not, see <http://www.gnu.org/licenses/> * 00020 ********************************************************************************* 00021 * $Id: FXSystem.h,v 1.18 2009/01/06 13:07:27 fox Exp $ * 00022 ********************************************************************************/ 00023 #ifndef FXSYSTEM_H 00024 #define FXSYSTEM_H 00025 00026 00027 00028 namespace FX { 00029 00030 00031 00032 namespace FXSystem { 00033 00034 00035 /// Convert time in nanoseconds since 1/1/1970 to local date string 00036 FXString FXAPI localTime(FXTime value); 00037 00038 /// Convert time in nanoseconds since 1/1/1970 to universal date string 00039 FXString FXAPI universalTime(FXTime value); 00040 00041 /** 00042 * Convert time in nanoseconds since 1/1/1970 to local date string as per strftime. 00043 * Format characters supported by most systems are: 00044 * 00045 * %a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y %Z %% 00046 * 00047 * Some systems support additional conversions. 00048 */ 00049 FXString FXAPI localTime(const FXchar *format,FXTime value); 00050 00051 /** 00052 * Convert time in nanoseconds since 1/1/1970 to universal date string as per strftime. 00053 */ 00054 FXString FXAPI universalTime(const FXchar *format,FXTime value); 00055 00056 00057 /// Get effective user id 00058 FXuint FXAPI user(); 00059 00060 /// Get effective group id 00061 FXuint FXAPI group(); 00062 00063 /// Return owner name from uid if available 00064 FXString FXAPI userName(FXuint uid); 00065 00066 /// Return group name from gid if available 00067 FXString FXAPI groupName(FXuint gid); 00068 00069 /// Get current effective user name 00070 FXString FXAPI currentUserName(); 00071 00072 /// Get current effective group name 00073 FXString FXAPI currentGroupName(); 00074 00075 00076 /// Get permissions string 00077 FXString FXAPI modeString(FXuint mode); 00078 00079 00080 00081 /// Return value of environment variable name 00082 FXString FXAPI getEnvironment(const FXString& name); 00083 00084 /// Change value of environment variable name, return true if success 00085 FXbool FXAPI setEnvironment(const FXString& name,const FXString& value); 00086 00087 00088 00089 /// Get the current working directory 00090 FXString FXAPI getCurrentDirectory(); 00091 00092 /// Set the current working directory 00093 FXbool FXAPI setCurrentDirectory(const FXString& path); 00094 00095 /// Return the current drive (for Win32 systems) 00096 FXString FXAPI getCurrentDrive(); 00097 00098 /// Set the current drive (for Win32 systems) 00099 FXbool FXAPI setCurrentDrive(const FXString& prefix); 00100 00101 00102 00103 /// Get executable path 00104 FXString FXAPI getExecPath(); 00105 00106 /// Return the home directory for the current user 00107 FXString FXAPI getHomeDirectory(); 00108 00109 /// Return the home directory for a given user 00110 FXString FXAPI getUserDirectory(const FXString& user); 00111 00112 /// Return temporary directory 00113 FXString FXAPI getTempDirectory(); 00114 00115 00116 /// Get process id 00117 FXint FXAPI getProcessId(); 00118 00119 00120 /// Return host name 00121 extern FXAPI FXString getHostName(); 00122 00123 00124 /// Determine if UTF8 locale in effect 00125 FXbool FXAPI localeIsUTF8(); 00126 00127 00128 /** 00129 * Get DLL name for given base name; for example "png" 00130 * becomes "libpng.so" on Linux, and "png.dll" on Windows. 00131 */ 00132 FXString FXAPI dllName(const FXString& name); 00133 00134 } 00135 00136 } 00137 00138 #endif
![]() |