34#include <NDEVR/String.h>
35#include <NDEVR/Time.h>
36#include <NDEVR/FileCachedData.h>
168 return static_cast<size_t>(
hash());
174 static constexpr char PathSep =
'/';
182 void checkError(
uint04 error)
const;
213 struct hash<
NDEVR::File>
215 std::size_t operator()(
const NDEVR::File& s)
const noexcept
217 return static_cast<size_t>(s.
hash());
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
const String & pathID() const
Definition File.h:145
static bool accessSort(const File &i, const File &j)
bool hasNullBytes(uint08 max_length=Constant< uint08 >::Max)
OpenMode m_open_mode
Definition File.h:187
Time getCreationTime() const
void setPath(const String &path, uint01 part)
bool copyTo(const File &cs, bool override_file, ProgressInfo *log=nullptr) const
FILE * open(OpenMode mode, bool append=false)
static String PathSepS
Definition File.h:180
Time getAccessTime() const
String pathNameID() const
uint01 m_path_start
Definition File.h:188
bool resolveNameFromMTPPath()
String m_id
Definition File.h:185
void deleteFile(ProgressInfo *log=nullptr)
FileCachedData m_cached_data
Definition File.h:184
File(const String &resource_name, const String &path_id)
void updateCache(const FileCachedData &cache)
static Buffer< File, uint04, ObjectAllocator< false > > SystemDrives()
File & operator=(File &&value) noexcept
static bool isPathSep(const char &path)
size_t operator()() const
Definition File.h:166
bool operator<<(const Buffer< uint01 > &values)
bool operator<<(const fltp08 &value)
String getFolderName() const
bool parentDirectoryExists() const
FILE * m_file_ptr
Definition File.h:186
File(const char *full_path)
void create(bool override_file) const
static bool nameSort(const File &i, const File &j)
bool updateAccessedTime(Time access_time) const
uint01 m_file_ext_start
Definition File.h:190
String getPath(uint01 file_parts) const
Buffer< uint01 > getData()
static constexpr char PathSep
Definition File.h:172
bool resolveMTPPath() const
static File TempFileFolder()
static constexpr char IDSep
Definition File.h:178
File findNonExistingSuitableName() const
static bool typeSort(const File &i, const File &j)
FilePart
Definition File.h:64
@ e_drive
Definition File.h:65
@ e_file_name
Definition File.h:67
@ e_full_path
Definition File.h:69
@ e_file_extension
Definition File.h:68
@ e_dir_path
Definition File.h:66
@ e_folder_name
Definition File.h:70
bool operator<<(const String &value)
String getDriveDescription() const
File & operator=(const File &value)
File getParentDirectory() const
Buffer< File, uint04, ObjectAllocator< false > > getChildren() const
static Buffer< File, uint04, ObjectAllocator< false > > MTPDevices()
bool updateAccessedTime() const
static constexpr char ExtSep
Definition File.h:176
void getFileTimes(Time &modified_time, Time &creation_time, Time &access_time) const
String relativePathTo(const File &reference) const
static bool doesFileExist(const String &name)
File & operator=(String &value)
File(const String &full_path)
File & append(const String &s)
static bool createSort(const File &i, const File &j)
File generateTempFile() const
static bool isIDSep(const char &path)
OpenMode
Definition File.h:51
@ e_ascii_read
Definition File.h:54
@ e_ascii_write_safe
Definition File.h:58
@ e_binary_read_safe
Definition File.h:57
@ e_ascii_write
Definition File.h:55
@ e_binary_read
Definition File.h:52
@ e_ascii_read_shared
Definition File.h:60
@ e_ascii_read_safe
Definition File.h:56
@ e_binary_write
Definition File.h:53
@ e_undefined
Definition File.h:61
@ e_binary_write_safe
Definition File.h:59
const FileCachedData & currentCache() const
bool moveTo(File &file, bool override_file, ProgressInfo *log=nullptr, bool is_source_temp=false)
File & append(const char &s)
void setFromDisplayString(const String &display_string)
Buffer< File, uint04, ObjectAllocator< false > > getChildrenMatching(const Buffer< String > &include_patterns, const Buffer< String > &exclude_patterns, bool recursive=false) const
uint01 m_file_name_start
Definition File.h:189
File & appendPath(const String &cs)
void throwIfNotExist() const
static constexpr char DriveSep
Definition File.h:177
bool m_id_valid
Definition File.h:191
Time getModifiedTime() const
bool operator<<(const fltp04 &value)
void removeInvalidChars()
void expandEnvironmentalVars()
File(File &&file) noexcept
Logic for searching for files based on some criteria.
Definition File.h:198
Buffer< String > search_extensions
Definition File.h:201
Buffer< File > performSearch() const
Buffer< File > excluded_list
Definition File.h:202
Buffer< File > files_recursively_to_search
Definition File.h:200
void performSearch(const File ¤t_file, Buffer< File > &files, uint04 recursion_level) const
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
The core String class for the NDEVR API.
Definition String.h:69
uint08 hash() const
Creates a simple, quick hash of the object. See hash(const char* value) for details of the implementa...
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:106
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
istream & operator>>(istream &in, NDEVR::String &string)
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233
Data that is cached from a file into program memory to limit expensive.
Definition FileCache.h:22