7 #ifndef NAZARA_FILE_HPP 8 #define NAZARA_FILE_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Core/ByteArray.hpp> 12 #include <Nazara/Core/Endianness.hpp> 13 #include <Nazara/Core/MovablePtr.hpp> 14 #include <Nazara/Core/Stream.hpp> 15 #include <Nazara/Core/String.hpp> 17 #if NAZARA_CORE_THREADSAFE && NAZARA_THREADSAFETY_FILE 18 #include <Nazara/Core/ThreadSafety.hpp> 20 #include <Nazara/Core/ThreadSafetyOff.hpp> 36 File(
File&& file) noexcept =
default;
39 bool Copy(
const String& newFilePath);
44 bool EndOfFile()
const;
45 bool EndOfStream()
const override;
49 time_t GetCreationTime()
const;
50 UInt64 GetCursorPos()
const override;
51 String GetDirectory()
const override;
52 String GetFileName()
const;
53 time_t GetLastAccessTime()
const;
54 time_t GetLastWriteTime()
const;
55 String GetPath()
const override;
56 UInt64 GetSize()
const override;
63 bool Rename(
const String& newFilePath);
65 bool SetCursorPos(CursorPosition pos, Int64 offset = 0);
66 bool SetCursorPos(UInt64 offset)
override;
67 bool SetFile(
const String& filePath);
68 bool SetSize(UInt64 size);
71 File& operator=(
const File&) =
delete;
72 File& operator=(
File&& file) noexcept =
default;
77 static bool Copy(
const String& sourcePath,
const String& targetPath);
78 static bool Delete(
const String& filePath);
79 static bool Exists(
const String& filePath);
80 static time_t GetCreationTime(
const String& filePath);
82 static time_t GetLastAccessTime(
const String& filePath);
83 static time_t GetLastWriteTime(
const String& filePath);
84 static UInt64 GetSize(
const String& filePath);
85 static bool IsAbsolute(
const String& filePath);
87 static String NormalizeSeparators(
const String& filePath);
88 static bool Rename(
const String& sourcePath,
const String& targetPath);
91 NazaraMutexAttrib(m_mutex,
mutable)
93 void FlushStream()
override;
94 std::size_t ReadBlock(
void* buffer, std::size_t size)
override;
95 std::size_t WriteBlock(
const void* buffer, std::size_t size)
override;
101 NAZARA_CORE_API
bool HashAppend(
AbstractHash* hash,
const File& originalFile);
104 #include <Nazara/Core/File.inl> 106 #endif // NAZARA_FILE_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
ByteArray ComputeHash(HashType hash, const T &v)
Computes the hash of a hashable object.
Definition: Algorithm.inl:98
Core class that represents the behaviour of the hash classes.
Definition: AbstractHash.hpp:18
Core class that represents a string.
Definition: String.hpp:22
Core class that represents a file.
Definition: File.hpp:29
Core class that represents an array of bytes.
Definition: ByteArray.hpp:18
Core class that represents a stream.
Definition: Stream.hpp:19