1 // Created on: 1992-05-27
2 // Created by: Stephan GARNAUD (ARM)
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _OSD_Disk_HeaderFile
18 #define _OSD_Disk_HeaderFile
20 #include <TCollection_AsciiString.hxx>
21 #include <OSD_Error.hxx>
22 #include <OSD_Path.hxx>
24 //! Disk management (a set of disk oriented tools)
31 //! Creates a disk object.
32 //! This is used only when a class contains a Disk field.
33 //! By default, its name is initialized to current working disk.
34 Standard_EXPORT OSD_Disk();
36 //! Initializes the object Disk with the disk name
37 //! associated to the OSD_Path.
38 Standard_EXPORT OSD_Disk(const OSD_Path& Name);
40 //! Initializes the object Disk with <PathName>.
41 //! <PathName> specifies any file within the mounted
43 //! Example : OSD_Disk myDisk ("/tmp")
44 //! Initializes a disk object with the mounted
45 //! file associated to /tmp.
46 Standard_EXPORT OSD_Disk(const Standard_CString PathName);
48 //! Returns disk name of <me>.
49 Standard_EXPORT OSD_Path Name() const;
51 //! Instantiates <me> with <Name>.
52 Standard_EXPORT void SetName (const OSD_Path& Name);
54 //! Returns total disk capacity in 512 bytes blocks.
55 Standard_EXPORT Standard_Integer DiskSize();
57 //! Returns free available 512 bytes blocks on disk.
58 Standard_EXPORT Standard_Integer DiskFree();
60 //! Returns TRUE if an error occurs
61 Standard_Boolean Failed() const { return myError.Failed(); }
63 //! Resets error counter to zero
64 void Reset() { myError.Reset(); }
67 void Perror() { myError.Perror(); }
69 //! Returns error number if 'Failed' is TRUE.
70 Standard_Integer Error() const { return myError.Error(); }
74 TCollection_AsciiString myDiskName;
79 #endif // _OSD_Disk_HeaderFile