![]() |
stromx
0.8.0
|
Data object which represents a path to a file. More...
#include <File.h>
Public Types | |
| enum | OpenMode { BINARY, TEXT } |
Public Member Functions | |
| File () | |
| File (const std::string &path, const OpenMode mode=TEXT) | |
| File (const File &file) | |
| const std::string & | path () const |
| OpenMode | mode () const |
| const std::string & | extension () const |
| void | setExtension (const std::string &extension) |
| virtual const Version & | version () const |
| virtual const std::string & | type () const |
| virtual const std::string & | package () const |
| virtual const VariantHandle & | variant () const |
| virtual Data * | clone () const |
| virtual void | serialize (OutputProvider &output) const |
| virtual void | deserialize (InputProvider &input, const Version &version) |
Public Member Functions inherited from stromx::runtime::DataInterface | |
| bool | isVariant (const VariantInterface &v) const |
Static Public Member Functions | |
| static const std::string & | tempDir () |
| static void | setTempDir (const std::string dir) |
| static const std::string | tempPath (const std::string &extension="") |
Data object which represents a path to a file.
|
inline |
Creates an empty file, i.e. a file object with no path.
Create a file object which represents the file at path.
| FileAccessFailed | If path does not exist or if path is not a file. |
| stromx::runtime::File::File | ( | const File & | file | ) |
Copy constructs the file, i.e. it creates a file object which references the same file as file.
|
inlinevirtual |
Returns a copy of the data object, i.e. a object of the same type is allocated and the data of the original object is copied to the new object. A pointer to the new object is returned.
Implements stromx::runtime::DataInterface.
|
virtual |
Deserializes a data object.
| out | The input which the data obtained from. |
| version | The version of the data class which serialized the input. |
Reimplemented from stromx::runtime::Data.
|
inline |
Returns the extension of this file.
|
inline |
Returns the mode of this file.
|
inlinevirtual |
Returns the package of the class of this data object.
Implements stromx::runtime::DataInterface.
|
inline |
Returns the path to this file.
|
virtual |
Serializes this data object.
| out | The output which the data is sent to. |
Reimplemented from stromx::runtime::Data.
| void stromx::runtime::File::setExtension | ( | const std::string & | extension | ) |
Sets the extension of a file with no path. Use this e.g. to indicate the file type of a parameter.
| WrongState | If the path of this file object is set, i.e. the extension is determined by the file path. |
|
static |
Sets the path to the directory where temporary files are stored. Pass an empty string to reset the temporary directory.
|
static |
Returns the path to the directory where temporary files are stored.
|
static |
Returns a path to an unique temporary file ending with extension.
|
inlinevirtual |
Returns the name of the class of this data object.
Implements stromx::runtime::DataInterface.
|
virtual |
Returns the data variant of this data object.
Implements stromx::runtime::DataInterface.
|
inlinevirtual |
Returns the version of the class of this data object.
Implements stromx::runtime::DataInterface.
1.8.12