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;
212 struct hash<
NDEVR::File>
214 std::size_t operator()(
const NDEVR::File& s)
const noexcept
216 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:59
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
NDEVR_BASE_API File & append(const char &s)
static NDEVR_BASE_API bool accessSort(const File &i, const File &j)
NDEVR_BASE_API void setInternalVars()
NDEVR_BASE_API uint08 fileSize() const
NDEVR_BASE_API FILE * filePtr()
NDEVR_BASE_API File findNonExistingSuitableName() const
NDEVR_BASE_API bool moveTo(File &file, bool override_file, ProgressInfo *log=nullptr, bool is_source_temp=false)
OpenMode m_open_mode
Definition File.h:187
String pathNameID() const
uint01 m_path_start
Definition File.h:188
NDEVR_BASE_API bool resolveNameFromMTPPath()
NDEVR_BASE_API File & operator=(const File &value)
NDEVR_BASE_API bool updateAccessedTime(Time access_time) const
NDEVR_BASE_API bool hasNullBytes(uint08 max_length=Constant< uint08 >::Max)
String m_id
Definition File.h:185
NDEVR_BASE_API bool parentDirectoryExists() const
static NDEVR_BASE_API File TempFileFolder()
NDEVR_BASE_API bool isDrive() const
NDEVR_BASE_API bool cachedExist() const
NDEVR_BASE_API File(const char *full_path)
NDEVR_BASE_API void deleteFile(ProgressInfo *log=nullptr)
static NDEVR_BASE_API Buffer< File, uint04, ObjectAllocator< false > > MTPDevices()
FileCachedData m_cached_data
Definition File.h:184
NDEVR_BASE_API bool exists() const
NDEVR_BASE_API void throwIfNotExist() const
NDEVR_BASE_API bool resolveMTPPath() const
size_t operator()() const
Definition File.h:166
NDEVR_BASE_API void create(bool override_file) const
NDEVR_BASE_API void getFileTimes(Time &modified_time, Time &creation_time, Time &access_time) const
NDEVR_BASE_API String getPath(uint01 file_parts) const
static NDEVR_BASE_API bool typeSort(const File &i, const File &j)
NDEVR_BASE_API File(File &&file) noexcept
NDEVR_BASE_API void updateCache(const FileCachedData &cache)
NDEVR_BASE_API void invalidateCache()
NDEVR_BASE_API File getParentDirectory() const
FILE * m_file_ptr
Definition File.h:186
static NDEVR_BASE_API bool doesFileExist(const String &name)
NDEVR_BASE_API String relativePathTo(const File &reference) const
NDEVR_BASE_API File & appendPath(const String &cs)
NDEVR_BASE_API void expandEnvironmentalVars()
NDEVR_BASE_API Time getAccessTime() const
uint01 m_file_ext_start
Definition File.h:190
static constexpr char PathSep
Definition File.h:172
static NDEVR_BASE_API bool isPathSep(const char &path)
NDEVR_BASE_API void setPath(const String &path, uint01 part)
NDEVR_BASE_API void updateCache() const
static NDEVR_BASE_API Buffer< File, uint04, ObjectAllocator< false > > SystemDrives()
NDEVR_BASE_API void setFromDisplayString(const String &display_string)
NDEVR_BASE_API const FileCachedData & currentCache() const
static constexpr char IDSep
Definition File.h:178
NDEVR_BASE_API File(const File &file)
NDEVR_BASE_API File & operator=(String &value)
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
NDEVR_BASE_API Buffer< File, uint04, ObjectAllocator< false > > getChildren() const
NDEVR_BASE_API bool isDirectory() const
static NDEVR_BASE_API bool isIDSep(const char &path)
NDEVR_BASE_API File & operator=(File &&value) noexcept
static constexpr char ExtSep
Definition File.h:176
NDEVR_BASE_API FILE * open(OpenMode mode, bool append=false)
NDEVR_BASE_API bool operator<<(const fltp04 &value)
NDEVR_BASE_API Time getModifiedTime() const
NDEVR_BASE_API bool operator<<(const String &value)
NDEVR_BASE_API File & append(const String &s)
NDEVR_BASE_API File generateTempFile() const
NDEVR_BASE_API bool isOpen() const
NDEVR_BASE_API Buffer< File, uint04, ObjectAllocator< false > > getChildrenMatching(const Buffer< String > &include_patterns, const Buffer< String > &exclude_patterns, bool recursive=false) const
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
NDEVR_BASE_API Buffer< uint01 > getData()
NDEVR_BASE_API void close()
NDEVR_BASE_API bool operator<<(const Buffer< uint01 > &values)
NDEVR_BASE_API String getDriveDescription() const
NDEVR_BASE_API bool isMTP() const
uint01 m_file_name_start
Definition File.h:189
NDEVR_BASE_API File(const String &resource_name, const String &path_id)
static constexpr char DriveSep
Definition File.h:177
NDEVR_BASE_API File(const String &full_path)
NDEVR_BASE_API File(String &&full_path)
NDEVR_BASE_API void removeInvalidChars()
NDEVR_BASE_API bool copyTo(const File &cs, bool override_file, ProgressInfo *log=nullptr) const
NDEVR_BASE_API String toDisplayString()
NDEVR_BASE_API bool isHidden() const
bool m_id_valid
Definition File.h:191
static NDEVR_BASE_API bool nameSort(const File &i, const File &j)
NDEVR_BASE_API UUID getUUID() const
NDEVR_BASE_API Time getCreationTime() const
NDEVR_BASE_API bool operator<<(const fltp08 &value)
NDEVR_BASE_API String getFolderName() const
NDEVR_BASE_API bool updateAccessedTime() const
static NDEVR_BASE_API bool createSort(const File &i, const File &j)
NDEVR_BASE_API void flush()
static NDEVR_BASE_API String PathSepS
Definition File.h:180
Logic for searching for files based on some criteria.
Definition File.h:197
Buffer< String > search_extensions
Definition File.h:200
Buffer< File > performSearch() const
Buffer< File > excluded_list
Definition File.h:201
Buffer< File > files_recursively_to_search
Definition File.h:199
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.
Definition ProgressInfo.hpp:48
The core String class for the software.
Definition String.h:47
NDEVR_BASE_API uint08 hash() const
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:62
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:125
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:78
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
Definition BaseValues.hpp:104
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:94
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:146
NDEVR_BASE_API istream & operator>>(istream &in, NDEVR::String &string)
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved.
Definition BaseValues.hpp:230
Data that is cached from a file into program memory to limit expensive.
Definition FileCache.h:22