Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:37

0001 // Created on: 2018-03-15
0002 // Created by: Stephan GARNAUD (ARM)
0003 // Copyright (c) 1998-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _OSD_Process_HeaderFile
0018 #define _OSD_Process_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <OSD_Error.hxx>
0025 #include <TCollection_AsciiString.hxx>
0026 
0027 class Quantity_Date;
0028 class OSD_Path;
0029 
0030 // undefine SetCurrentDirectory that can be #defined by previous inclusion of windows.h
0031 #ifdef SetCurrentDirectory
0032 # undef SetCurrentDirectory
0033 #endif
0034 
0035 //! A set of system process tools
0036 class OSD_Process 
0037 {
0038 public:
0039 
0040   //! Return full path to the current process executable.
0041   Standard_EXPORT static TCollection_AsciiString ExecutablePath();
0042 
0043   //! Return full path to the folder containing current process executable with trailing separator.
0044   Standard_EXPORT static TCollection_AsciiString ExecutableFolder();
0045 
0046 public:
0047 
0048   DEFINE_STANDARD_ALLOC
0049   
0050   //! Initializes the object and prepare for a possible dump
0051   Standard_EXPORT OSD_Process();
0052   
0053   //! Returns the terminal used (vt100, vt200 ,sun-cmd ...)
0054   Standard_EXPORT void TerminalType (TCollection_AsciiString& Name);
0055   
0056   //! Gets system date.
0057   Standard_EXPORT Quantity_Date SystemDate();
0058   
0059   //! Returns the user name.
0060   Standard_EXPORT TCollection_AsciiString UserName();
0061   
0062   //! Returns True if the process user is the super-user.
0063   Standard_EXPORT Standard_Boolean IsSuperUser();
0064   
0065   //! Returns the 'Process Id'
0066   Standard_EXPORT Standard_Integer ProcessId();
0067   
0068   //! Returns the current path where the process is.
0069   Standard_EXPORT OSD_Path CurrentDirectory();
0070   
0071   //! Changes the current process directory.
0072   Standard_EXPORT void SetCurrentDirectory (const OSD_Path& where);
0073   
0074   //! Returns TRUE if an error occurs
0075   Standard_EXPORT Standard_Boolean Failed() const;
0076   
0077   //! Resets error counter to zero
0078   Standard_EXPORT void Reset();
0079   
0080   //! Raises OSD_Error
0081   Standard_EXPORT void Perror();
0082   
0083   //! Returns error number if 'Failed' is TRUE.
0084   Standard_EXPORT Standard_Integer Error() const;
0085 
0086 private:
0087   OSD_Error myError;
0088 };
0089 
0090 #endif // _OSD_Process_HeaderFile