Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXSystem.h

Go to the documentation of this file.
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,2006 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (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 GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXSystem.h,v 1.6 2006/01/22 17:58:10 fox Exp $                           *
00023 ********************************************************************************/
00024 #ifndef FXSYSTEM_H
00025 #define FXSYSTEM_H
00026 
00027 
00028 
00029 namespace FX {
00030 
00031 
00032 
00033 namespace FXSystem {
00034 
00035 
00036 /// Return current time
00037 FXTime FXAPI now();
00038 
00039 /// Convert time value to date-string
00040 FXString FXAPI time(FXTime value);
00041 
00042 /**
00043 * Convert time value to date-string as per strftime.
00044 * Format characters supported by most systems are:
00045 *
00046 *  %a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y %Z %%
00047 *
00048 * Some systems support additional conversions.
00049 */
00050 FXString FXAPI time(const FXchar *format,FXTime value);
00051 
00052 
00053 
00054 /// Get effective user id
00055 FXuint FXAPI user();
00056 
00057 /// Get effective group id
00058 FXuint FXAPI group();
00059 
00060 /// Return owner name from uid if available
00061 FXString FXAPI userName(FXuint uid);
00062 
00063 /// Return group name from gid if available
00064 FXString FXAPI groupName(FXuint gid);
00065 
00066 /// Get current effective user name
00067 FXString FXAPI currentUserName();
00068 
00069 /// Get current effective group name
00070 FXString FXAPI currentGroupName();
00071 
00072 
00073 /// Get permissions string
00074 FXString FXAPI modeString(FXuint mode);
00075 
00076 
00077 
00078 /// Return value of environment variable name
00079 FXString FXAPI getEnvironment(const FXString& name);
00080 
00081 /// Change value of environment variable name, return true if success
00082 bool FXAPI setEnvironment(const FXString& name,const FXString& value);
00083 
00084 
00085 
00086 /// Get the current working directory
00087 FXString FXAPI getCurrentDirectory();
00088 
00089 /// Set the current working directory
00090 FXbool FXAPI setCurrentDirectory(const FXString& path);
00091 
00092 /// Return the current drive (for Win32 systems)
00093 FXString FXAPI getCurrentDrive();
00094 
00095 /// Set the current drive (for Win32 systems)
00096 FXbool FXAPI setCurrentDrive(const FXString& prefix);
00097 
00098 
00099 
00100 /// Get executable path
00101 FXString FXAPI getExecPath();
00102 
00103 /// Return the home directory for the current user
00104 FXString FXAPI getHomeDirectory();
00105 
00106 /// Return the home directory for a given user
00107 FXString FXAPI getUserDirectory(const FXString& user);
00108 
00109 /// Return temporary directory
00110 FXString FXAPI getTempDirectory();
00111 
00112 
00113 
00114 /**
00115 * Get DLL name for given base name; for example "png"
00116 * becomes "libpng.so" on Linux, and "png.dll" on Windows.
00117 */
00118 FXString FXAPI dllName(const FXString& name);
00119 
00120 }
00121 
00122 }
00123 
00124 #endif

Copyright © 1997-2005 Jeroen van der Zijp