This field stores the directory separator character based on the operating system.
More...
|
| | File () |
| | Default constructor. The file has no name.
|
| |
| | File (const String &pathname) |
| | Constructor.
|
| |
| | File (String parent, String child) |
| | Constructor.
|
| |
| | File (const File &parent, String child) |
| | Constructor.
|
| |
| | File (const File &other) |
| | Copy constructor.
|
| |
| | ~File () override=default |
| | Destructor.
|
| |
| bool | isNull () const |
| | checks if the file is null (has no path).
|
| |
| bool | canExecute () const |
| | Checks if the file can be executed.
|
| |
| bool | canRead () const override |
| | Checks if the file can be read.
|
| |
| bool | canWrite () const |
| | Checks if the file can be written.
|
| |
| bool | createNewFile () |
| | Creates a new file, but only, if the file not exist. If the file exists, nothing happens.
|
| |
| bool | makeDirectory () |
| | Create a new directory.
|
| |
| bool | exists () const |
| | Checks if the file exists.
|
| |
| bool | remove () |
| | This method deletes the file permanently. If it is a directory, it will only be deleted if it is empty.
|
| |
| bool | moveToTrash () |
| | Moves the file to the system trash.
|
| |
| bool | renameTo (const String &newPath) |
| | Renames the file to a new name.
|
| |
| String | name () const |
| | Returns the name of the file. This is the pure name without any path information.
|
| |
| String | parent () const |
| | Returns the directory path of the file, excluding the file name itself. It corresponds to the directory in which this file is located.
|
| |
| const String & | absolutePath () const |
| | Returns the absolute path of the file from the root of the file system.
|
| |
| String | path () const |
| | Returns the full path of this file. The path can be relative or absolute.
|
| |
| String | extension () const |
| | This method returns the file extension of the file. If the file does not have an extension, the return value is an empty string. An extension is indicated by a dot. For ".tar.gz", only "gz" is returned.
|
| |
| bool | isAbsolute () const |
| | Checks if this file is an absolute path.
|
| |
| bool | isDirectory () const |
| | Checks if this file is a directory.
|
| |
| bool | isFile () const |
| | Checks if this file is a regular file.
|
| |
| bool | isLink () const |
| | Checks if this file is a symbolic link.
|
| |
| bool | isPipe () const |
| | Checks if this file is a named pipe (FIFO).
|
| |
| bool | isHidden () const |
| | Checks if this file is hidden.
|
| |
| Array< File > * | listFiles () const |
| | Retrieves a list of all files in the directory.
|
| |
| size_t | size () const override |
| | Returns the size of the file in bytes.
|
| |
| Date | lastModified () const |
| | Returns the date of the last modification.
|
| |
| Status | open (FileMode mode) override |
| | Opens the file for read or write operations.
|
| |
| bool | isOpen () override |
| | Checks if the file is open.
|
| |
| void | close () override |
| | Closes the file if it was previously opened.
|
| |
| size_t | read (unsigned char *buffer, size_t size) override |
| | Reads a maximum of length bytes into the array. \discussion For large blocks, it is possible that not all bytes are read because it is still waiting for data. In this case, only a portion may be returned. If you want to ensure that all data is read, you should call "readFully".
|
| |
| size_t | readFully (ByteArray &buffer, size_t length) override |
| | Reads a maximum of length bytes into the array.
|
| |
| void | seek (size_t position) override |
| | Moves the file cursor to the desired position, counted from the beginning of the file.
|
| |
| void | move (ssize_t offset) override |
| | Moves the file cursor to the desired position, relative to the current position.
|
| |
| size_t | position () override |
| | Returns the current cursor position in the file.
|
| |
| size_t | write (const uint8 *buffer, size_t length) override |
| | Writes a buffer to the output file.
|
| |
| int32 | compareTo (const File &other) const override |
| | Compares the absolute file path with another file's absolute path.
|
| |
| StringList | getTags () const |
| | Returns the tags of the file.
|
| |
| Status | addTag (const String &tag) |
| | Adds a tag to the file. If the tag already exists, nothing happens.
|
| |
| Status | removeTag (const String &tag) |
| | Remove a tag from the file. If the tag not exists, nothing happens.
|
| |
| File & | operator= (const File &another) |
| |
| | Stream () |
| | Constructor.
|
| |
| size_t | readFully (ByteArray &buffer) |
| | Reads a maximum of length bytes into the array.
|
| |
| size_t | write (const int8 *buffer, size_t length) |
| | Writes a buffer to the output file.
|
| |
| size_t | write (const String &string) |
| | Writes a string to the output file. The encoding is the default encoding (UTF-8). NOT AS A C-STRING!
|
| |
| | Object () noexcept |
| | Constructor.
|
| |
| virtual | ~Object () noexcept |
| | Destructor.
|
| |
| void | release () noexcept |
| | Decreases the reference counter and releases the object immediately when the reference counter becomes 0.
|
| |
| Object * | retain () noexcept |
| | Increases the reference counter of this object by 1.
|
| |
| Object * | autorelease () noexcept |
| | Same function as release(), but releases the object with a delay if the reference counter is 0. AutoreleasePool::drain() must be called in the to release the object.
|
| |
| int32 | referenceCount () const noexcept |
| | Returns the value of the reference counter.
|
| |
| virtual bool | equals (const Object *other) const |
| | Comparison of objects.
|
| |
| virtual String | displayName () const |
| | Returns the display name of the object intended to present to a user.
|
| |
| virtual void | printDiffInfo (DiffOperation operation, Object *other) const |
| | Output method for outputting the diff results for the diff algorithm.
|
| |
| void | setHighBit (bool status) noexcept |
| |
| bool | highBit () const noexcept |
| |
| | Comparable () |
| |
| virtual | ~Comparable () |
| |
This field stores the directory separator character based on the operating system.
This class is a representation of file or directory paths. In addition, data can be read from and written to the hard disk.