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

FXSystem.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * 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 *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2005,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXSystem.h,v 1.6 2006/01/22 17:58:10 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXSYSTEM_H
25 #define FXSYSTEM_H
26 
27 
28 
29 namespace FX {
30 
31 
32 
33 namespace FXSystem {
34 
35 
36 /// Return current time
37 FXTime FXAPI now();
38 
39 /// Convert time value to date-string
40 FXString FXAPI time(FXTime value);
41 
42 /**
43 * Convert time value to date-string as per strftime.
44 * Format characters supported by most systems are:
45 *
46 * %a %A %b %B %c %d %H %I %j %m %M %p %S %U %w %W %x %X %y %Y %Z %%
47 *
48 * Some systems support additional conversions.
49 */
50 FXString FXAPI time(const FXchar *format,FXTime value);
51 
52 
53 
54 /// Get effective user id
55 FXuint FXAPI user();
56 
57 /// Get effective group id
59 
60 /// Return owner name from uid if available
62 
63 /// Return group name from gid if available
65 
66 /// Get current effective user name
68 
69 /// Get current effective group name
71 
72 
73 /// Get permissions string
75 
76 
77 
78 /// Return value of environment variable name
80 
81 /// Change value of environment variable name, return true if success
82 bool FXAPI setEnvironment(const FXString& name,const FXString& value);
83 
84 
85 
86 /// Get the current working directory
88 
89 /// Set the current working directory
91 
92 /// Return the current drive (for Win32 systems)
94 
95 /// Set the current drive (for Win32 systems)
96 FXbool FXAPI setCurrentDrive(const FXString& prefix);
97 
98 
99 
100 /// Get executable path
102 
103 /// Return the home directory for the current user
105 
106 /// Return the home directory for a given user
108 
109 /// Return temporary directory
111 
112 
113 
114 /**
115 * Get DLL name for given base name; for example "png"
116 * becomes "libpng.so" on Linux, and "png.dll" on Windows.
117 */
118 FXString FXAPI dllName(const FXString& name);
119 
120 }
121 
122 }
123 
124 #endif
FXString getHomeDirectory()
Return the home directory for the current user.
FXString time(FXTime value)
Convert time value to date-string.
FXString getCurrentDrive()
Return the current drive (for Win32 systems)
FXString currentUserName()
Get current effective user name.
char FXchar
Definition: fxdefs.h:387
unsigned int FXuint
Definition: fxdefs.h:396
FXString modeString(FXuint mode)
Get permissions string.
#define FXAPI
Definition: fxdefs.h:122
FXString groupName(FXuint gid)
Return group name from gid if available.
FXuchar FXbool
Definition: fxdefs.h:393
FXbool setCurrentDrive(const FXString &prefix)
Set the current drive (for Win32 systems)
FXuint group()
Get effective group id.
FXString dllName(const FXString &name)
Get DLL name for given base name; for example "png" becomes "libpng.so" on Linux, and "png...
FXString name(const FXString &file)
Return name and extension part of the path name.
FXbool setCurrentDirectory(const FXString &path)
Set the current working directory.
long FXTime
Definition: fxdefs.h:448
Definition: FX4Splitter.h:31
bool setEnvironment(const FXString &name, const FXString &value)
Change value of environment variable name, return true if success.
FXString getCurrentDirectory()
Get the current working directory.
FXString getTempDirectory()
Return temporary directory.
FXString getEnvironment(const FXString &name)
Return value of environment variable name.
FXTime now()
Return current time.
FXString getExecPath()
Get executable path.
FXString getUserDirectory(const FXString &user)
Return the home directory for a given user.
FXuint user()
Get effective user id.
FXString currentGroupName()
Get current effective group name.
FXString userName(FXuint uid)
Return owner name from uid if available.
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp