(file) Return to System.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 mike  1.13 //%/////////////////////////////////////////////////////////////////////////////
  2            //
  3            // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
  4            //
  5            // Permission is hereby granted, free of charge, to any person obtaining a copy
  6 chip  1.13.2.1 // of this software and associated documentation files (the "Software"), to
  7                // deal in the Software without restriction, including without limitation the
  8                // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9 mike  1.13     // sell copies of the Software, and to permit persons to whom the Software is
 10                // furnished to do so, subject to the following conditions:
 11 chip  1.13.2.1 //
 12                // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 13 mike  1.13     // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 14                // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 15 chip  1.13.2.1 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 16                // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 17                // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 18 mike  1.13     // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 19                // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 20                //
 21                //==============================================================================
 22                //
 23                // Author: Mike Brasher (mbrasher@bmc.com)
 24                //
 25 kumpf 1.13.2.2 // Modified By: 
 26 mike  1.13     //
 27                //%/////////////////////////////////////////////////////////////////////////////
 28                
 29                #ifndef Pegasus_System_h
 30                #define Pegasus_System_h
 31                
 32                #include <Pegasus/Common/Config.h>
 33                #include <Pegasus/Common/String.h>
 34                
 35                PEGASUS_NAMESPACE_BEGIN
 36                
 37                /** This is an opaque type which is used to represent dynamic library
 38                    handles returned by the System::loadDynamicLibrary() method and
 39                    accepted by the System::loadDynamicProcedure() method.
 40                */
 41                typedef struct DynamicLibraryHandle_* DynamicLibraryHandle;
 42                
 43                /** This is an opaque type which is returned by System::loadDynamicSymbol().
 44                    Values of this type may be casted to the appropriate target type.
 45                */
 46                typedef struct DynamicSymbolHandle_* DynamicSymbolHandle;
 47 chip  1.13.2.1 
 48 mike  1.13     
 49                /** The System class defines wrappers for operating system related calls.
 50                    These are only placed here if they are extremely light. These are
 51                    usually just direct wrappers which map more or less one to one to the
 52                    underlying function.
 53                */
 54                class PEGASUS_COMMON_LINKAGE System
 55                {
 56                public:
 57                    /** getCurrentTime - Gets the current time as seconds and milliseconds
 58                    into the provided variables using system functions.
 59                    @param seconds Return for the seconds component of the time.
 60                    @param milliseconds Return for the milliseconds component of the time.
 61                    @return The value is returned in the parameters.
 62                    The time returned is as defined in number of seconds and milliseconds
 63                    since 00:00 Coordinated Universal Time (UTC), January 1, 1970,
 64 chip  1.13.2.1 
 65 mike  1.13         */
 66                    static void getCurrentTime(Uint32& seconds, Uint32& milliseconds);
 67                
 68                    /** getCurrentASCIITime Gets time/date in a fixed format. The format is
 69                        YY MM DD-HH:MM:SS
 70                	@return Returns String with the ASCII time date.
 71                    */
 72                    static String getCurrentASCIITime();
 73                
 74                    static void sleep(Uint32 seconds);
 75                
 76                    static Boolean exists(const char* path);
 77                
 78                    static Boolean canRead(const char* path);
 79                
 80                    static Boolean canWrite(const char* path);
 81                
 82                    static Boolean getCurrentDirectory(char* path, Uint32 size);
 83                
 84                    static Boolean isDirectory(const char* path);
 85                
 86 mike  1.13         static Boolean changeDirectory(const char* path);
 87                
 88                    static Boolean makeDirectory(const char* path);
 89                
 90                    static Boolean getFileSize(const char* path, Uint32& size);
 91                
 92                    static Boolean removeDirectory(const char* path);
 93                
 94                    static Boolean removeFile(const char* path);
 95                
 96                    static Boolean renameFile(const char* oldPath, const char* newPath);
 97                
 98                    static DynamicLibraryHandle loadDynamicLibrary(const char* fileName);
 99 chip  1.13.2.1 
100                	static void unloadDynamicLibrary(DynamicLibraryHandle libraryHandle);
101 mike  1.13     
102                    static String dynamicLoadError(void);
103                
104                    static DynamicSymbolHandle loadDynamicSymbol(
105                	DynamicLibraryHandle libraryHandle,
106                	const char* symbolName);
107                
108                    static String getHostName();
109 kumpf 1.13.2.2 
110                    /**
111                    This function is used to input a password with echo disabled.
112                    The function reads up to a newline and returns a password of at most
113                    8 characters.
114                
115                    @param  prompt      String containing the message prompt to be displayed
116                    @return             password obtained from the user
117                    */ 
118                    static String getPassword(const char* prompt);
119 mike  1.13     };
120                
121                PEGASUS_NAMESPACE_END
122                
123                #endif /* Pegasus_System_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2