(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            // 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            // 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            // 
 12            // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN 
 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            // 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            // 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 mike  1.13 //
 23            // Author: Mike Brasher (mbrasher@bmc.com)
 24            //
 25            // Modified By:
 26            //
 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 mike  1.13 /** 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                
 48            
 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 mike  1.13     
 65                */
 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 mike  1.13 
 86                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            
100                static String dynamicLoadError(void);
101            
102                static DynamicSymbolHandle loadDynamicSymbol(
103            	DynamicLibraryHandle libraryHandle,
104            	const char* symbolName);
105            
106 mike  1.13     static String getHostName();
107            };
108            
109            PEGASUS_NAMESPACE_END
110            
111            #endif /* Pegasus_System_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2