Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 2024-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_FileNode_HeaderFile
0018 #define _OSD_FileNode_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <OSD_Path.hxx>
0023 #include <OSD_Error.hxx>
0024 
0025 class OSD_Protection;
0026 class Quantity_Date;
0027 
0028 
0029 //! A class for 'File' and 'Directory' grouping common
0030 //! methods (file/directory manipulation tools).
0031 //! The "file oriented" name means files or directories which are
0032 //! in fact hard coded as files.
0033 class OSD_FileNode 
0034 {
0035 public:
0036 
0037   DEFINE_STANDARD_ALLOC
0038 
0039   
0040   //! Gets file name and path.
0041   Standard_EXPORT void Path (OSD_Path& Name) const;
0042   
0043   //! Sets file name and path.
0044   //! If a name is not found, it raises a program error.
0045   Standard_EXPORT void SetPath (const OSD_Path& Name);
0046   
0047   //! Returns TRUE if <me> exists.
0048   Standard_EXPORT Standard_Boolean Exists();
0049   
0050   //! Erases the FileNode from directory
0051   Standard_EXPORT void Remove();
0052   
0053   //! Moves <me> into another directory
0054   Standard_EXPORT void Move (const OSD_Path& NewPath);
0055   
0056   //! Copies <me> to another FileNode
0057   Standard_EXPORT void Copy (const OSD_Path& ToPath);
0058 
0059   // None of the existing security APIs are supported in a UWP applications
0060   //! Returns access mode of <me>.
0061   Standard_EXPORT OSD_Protection Protection();
0062   
0063   //! Changes protection of the FileNode
0064   Standard_EXPORT void SetProtection (const OSD_Protection& Prot);
0065 
0066   //! Returns last write access.
0067   //! On UNIX, AccessMoment and CreationMoment return the
0068   //! same value.
0069   Standard_EXPORT Quantity_Date AccessMoment();
0070   
0071   //! Returns creation date.
0072   //! On UNIX, AccessMoment and CreationMoment return the
0073   //! same value.
0074   Standard_EXPORT Quantity_Date CreationMoment();
0075   
0076   //! Returns TRUE if an error occurs
0077   Standard_EXPORT Standard_Boolean Failed() const;
0078   
0079   //! Resets error counter to zero
0080   Standard_EXPORT void Reset();
0081   
0082   //! Raises OSD_Error
0083   Standard_EXPORT void Perror();
0084   
0085   //! Returns error number if 'Failed' is TRUE.
0086   Standard_EXPORT Standard_Integer Error() const;
0087 
0088 protected:
0089   
0090   //! Creates FileNode object
0091   //! This is to be used with SetPath .
0092   //! Allocate space for the file name and initializes this
0093   //! name to an empty name.
0094   Standard_EXPORT OSD_FileNode();
0095   
0096   //! Instantiates the object FileNode storing its name.
0097   //! If a name is not found, it raises a program error.
0098   Standard_EXPORT OSD_FileNode(const OSD_Path& Name);
0099 
0100   //! Destructor is protected for safer inheritance
0101   ~OSD_FileNode () {}
0102 
0103 protected:
0104 
0105   OSD_Path myPath;
0106   OSD_Error myError;
0107 };
0108 
0109 
0110 #endif // _OSD_FileNode_HeaderFile