SetLogging(
ESwitchon_off_default);
221 static voidSetHonorUmask(
ESwitchon_off_default);
239 static voidSetDeleteReadOnlyFiles(
ESwitchon_off_default);
277 const string& GetPath(
void)
const;
280 voidReset(
const string& path);
303 static voidSplitPath(
const string& path,
304 string* dir = 0,
string* base = 0,
string* ext = 0);
323 static voidSplitPathEx(
const string& path,
324 string* disk = 0,
string* dir = 0,
325 string* base = 0,
string* ext = 0);
342 stringGetDir(EIfEmptyPath
mode= eIfEmptyPath_Current)
const;
345 stringGetName(
void)
const;
348 string GetBase(
void)
const;
351 stringGetExt (
void)
const;
365 static stringMakePath(
const string& dir =
kEmptyStr,
370 static charGetPathSeparator(
void);
374 static boolIsPathSeparator(
const charc);
377 static stringAddTrailingPathSeparator(
const string& path);
380 static stringDeleteTrailingPathSeparator(
const string& path);
386 static stringConvertToOSPath(
const string& path);
391 static boolIsAbsolutePath(
const string& path);
396 static boolIsAbsolutePathEx(
const string& path);
415 static stringGetNearestExistingParentDir(
const string& path);
429 static stringCreateRelativePath(
const string& path_from,
430 const string& path_to);
455 static stringCreateAbsolutePath(
const string& path,
456ERelativeToWhat rtw = eRelativeToCwd);
469 static stringCreateAbsolutePath(
const string& path,
const string& rtw);
480 static stringConcatPath(
const string&
first,
const string& second);
491 static stringConcatPathEx(
const string&
first,
const string& second);
501 static stringNormalizePath(
const string& path,
510 static boolMatchesMask(
const string& name,
const string&
mask,
515 static boolMatchesMask(
const string& name,
constvector<string>& masks,
520 static boolMatchesMask(
const string& name,
const CMask&
mask,
524 virtual boolExists(
void)
const;
535fCF_Overwrite = (1 << 1),
537fCF_Update = (1 << 2) | fCF_Overwrite,
539fCF_Backup = (1 << 3) | fCF_Overwrite,
548fCF_Safe = (1 << 4) | fCF_Overwrite,
553fCF_TopDirOnly = (1 << 6),
556fCF_EqualTypes = (1 << 7),
558fCF_FollowLinks = (1 << 8),
559fCF_Verify = (1 << 9),
560fCF_PreserveOwner = (1 << 10),
561fCF_PreservePerm = (1 << 11),
562fCF_PreserveTime = (1 << 12),
563fCF_PreserveAll = fCF_PreserveOwner | fCF_PreservePerm | fCF_PreserveTime,
564fCF_Recursive = (1 << 14),
566fCF_SkipUnsupported = (1 << 15),
568fCF_Default = fCF_Recursive | fCF_FollowLinks
589 virtual boolCopy(
const string& new_path,
TCopyFlags flags= fCF_Default,
590 size_tbuf_size = 0)
const;
607 size_tbuf_size = 0)
const;
612fRF_Overwrite = (1 << 1),
614fRF_Update = (1 << 2) | fCF_Overwrite,
616fRF_Backup = (1 << 3) | fCF_Overwrite,
618fRF_EqualTypes = (1 << 4),
620fRF_FollowLinks = (1 << 5),
658 static const char* GetBackupSuffix(
void);
664 static voidSetBackupSuffix(
const char* suffix);
668eBackup_Copy = (1 << 1),
669eBackup_Rename = (1 << 2),
670eBackup_Default = eBackup_Copy
694 boolBackup(
const string& suffix =
kEmptyStr,
695EBackupMode
mode= eBackup_Default,
696TCopyFlags copyflags = fCF_Default,
697 size_tcopybufsize = 0);
712fDir_Files = (1 << 1),
713fDir_Subdirs = (1 << 2),
714fDir_Recursive = (1 << 3),
717fDir_All = fDir_Self + fDir_Files + fDir_Subdirs,
721fIgnoreMissing = (1 << 4),
722fProcessAll = (1 << 5),
728eOnlyEmpty = fDir_Self,
729eEntryOnly = fDir_Self,
733eTopDirOnly = fDir_Self | fDir_Files,
737eNonRecursive = fDir_All,
752eRecursiveNotStopOnErrors =
eRecursive| fIgnoreMissing | fProcessAll
877 boolIsLink(
void)
const;
887 stringLookupLink(
void)
const;
910 voidDereferencePath(
void);
927 boolGetTime(
CTime* modification,
928 CTime* last_access = 0,
929 CTime* creation = 0)
const;
939 boolGetTimeT(time_t* modification,
940time_t* last_access = 0,
941time_t* creation = 0)
const;
965 boolSetTime(
const CTime* modification = 0,
966 const CTime* last_access = 0,
967 const CTime* creation = 0)
const;
984 boolSetTimeT(
consttime_t* modification = 0,
985 consttime_t* last_access = 0,
986 consttime_t* creation = 0)
const;
1009 boolIsNewer(time_t tm,
1010EIfAbsent if_absent
)
const;
1023 boolIsNewer(
const CTime& tm,
1024EIfAbsent if_absent
)
const;
1038fHasThisNoPath_Newer = (1 << 0),
1039fHasThisNoPath_NotNewer = (1 << 1),
1040fNoThisHasPath_Newer = (1 << 2),
1041fNoThisHasPath_NotNewer = (1 << 3),
1042fNoThisNoPath_Newer = (1 << 4),
1043fNoThisNoPath_NotNewer = (1 << 5)
1056 boolIsNewer(
const string& path,
1069 boolIsIdentical(
const string& entry_name,
1108 boolGetOwner(
string* owner,
string* group = 0,
1110 unsigned int* uid = 0,
unsigned int* gid = 0)
const;
1142 boolSetOwner(
const string& owner,
const string& group =
kEmptyStr,
1144 unsigned int* uid = 0,
unsigned int* gid = 0)
const;
1158fDefaultDirUser = fRead | fExecute | fWrite,
1160fDefaultDirGroup = fRead | fExecute,
1162fDefaultDirOther = fRead | fExecute,
1166fDefaultUser = fRead | fWrite,
1168fDefaultGroup = fRead,
1170fDefaultOther = fRead
1204 boolGetMode(TMode* user_mode,
1205TMode* group_mode = 0,
1206TMode* other_mode = 0,
1207TSpecialModeBits* special = 0)
const;
1233 virtual boolSetMode(
1235TMode group_mode = fDefault,
1236TMode other_mode = fDefault,
1237TSpecialModeBits special = 0,
1238TSetModeFlags
flags= eEntryOnly)
const;
1246 virtual boolSetModeEntry(
1248TMode group_mode = fDefault,
1249TMode other_mode = fDefault,
1250TSpecialModeBits special = 0,
1251TSetModeFlags
flags= eEntryOnly)
const;
1273 static voidSetDefaultModeGlobal(
1276TMode group_mode = fDefault,
1277TMode other_mode = fDefault,
1278TSpecialModeBits special = 0);
1285 virtual voidSetDefaultMode(EType entry_type,
1287TMode group_mode = fDefault,
1288TMode other_mode = fDefault,
1289TSpecialModeBits special = 0);
1324 boolCheckAccess(TMode access_mode)
const;
1330 static mode_tMakeModeT(TMode user_mode,
1333TSpecialModeBits special);
1346TMode* group_mode = 0,
1347TMode* other_mode = 0,
1348TSpecialModeBits* special = 0);
1357eModeFormat_Default = eModeFormat_Octal
1364 static stringModeToString(TMode user_mode,
1367TSpecialModeBits special,
1368EModeStringFormat
format= eModeFormat_Default);
1377TMode* group_mode = 0,
1378TMode* other_mode = 0,
1379TSpecialModeBits* special = 0);
1389 static voidGetUmask(TMode* user_mode,
1390TMode* group_mode = 0,
1391TMode* other_mode = 0,
1392TSpecialModeBits* special = 0);
1404 static voidSetUmask(TMode user_mode,
1405TMode group_mode = fDefault,
1406TMode other_mode = fDefault,
1407TSpecialModeBits special = 0);
1440 static stringGetTmpName(ETmpFileCreationMode
mode= eTmpFileGetName);
1469 static stringGetTmpNameEx(
const string& dir =
kEmptyStr,
1471ETmpFileCreationMode
mode= eTmpFileGetName);
1507 staticfstream* CreateTmpFile(
const string& filename =
kEmptyStr,
1508ETextBinary text_binary = eBinary,
1509EAllowRead allow_read = eAllowRead);
1540 staticfstream* CreateTmpFileEx(
const string& dir =
".",
1542ETextBinary text_binary = eBinary,
1543EAllowRead allow_read = eAllowRead);
1549 static voidGetDefaultModeGlobal(EType entry_type,
1553TSpecialModeBits* special);
1558 voidGetDefaultMode(TMode* user_mode,
1561TSpecialModeBits* special)
const;
1562 mode_tGetDefaultModeT(
void)
const;
1589 static stringx_ModeToSymbolicString(
EWhowho,
TMode mode,
boolspecial_bit,
charfiller);
1619 virtual~
CFile(
void);
1629 virtual boolExists(
void)
const;
1650 virtual boolCopy(
const string& new_path, TCopyFlags
flags= fCF_Default,
1651 size_tbuf_size = 0)
const;
1662 bool Compare(
const string&
file,
size_tbuf_size = 0)
const;
1683 boolCompareTextContents(
const string&
file, ECompareText
mode,
1684 size_tbuf_size = 0)
const;
1704 CDir(
const string& dirname);
1710 virtual~
CDir(
void);
1719 virtual boolExists(
void)
const;
1728eHomeWindows_UserProfile
1731 static stringGetHome(EHomeWindows home = eHomeWindows_AppData);
1737 static stringGetTmpDir(
void);
1750 static stringGetAppTmpDir(
void);
1753 static stringGetCwd(
void);
1756 static boolSetCwd(
const string& dir);
1765fIgnoreRecursive = (1<<1),
1768fCreateObjects = (1<<2),
1775fIgnorePath = (1<<4),
1777fThrowOnError = (1<<5),
1784eIgnoreRecursive = fIgnoreRecursive
1820 TEntriesGetEntries(
constvector<string>& masks,
1866 TEntries* GetEntriesPtr(
constvector<string>& masks,
1895 TEntriesGetEntries (
constvector<string>& masks,
1910 TEntries* GetEntriesPtr(
constvector<string>& masks,
1927fCreate_Default = 0,
1930fCreate_PermByUmask = (1 << 1),
1932fCreate_PermAsParent = (1 << 2),
1935fCreate_ErrorIfExists = (1 << 3),
1939fCreate_UpdateIfExists = (1 << 4)
1975 virtual boolCopy(
const string& new_path,
TCopyFlags flags= fCF_Default,
1976 size_tbuf_size = 0)
const;
2049 virtual boolSetMode(
TModeuser_mode,
2050 TModegroup_mode = fDefault,
2051 TModeother_mode = fDefault,
2087 virtual boolExists(
void)
const;
2096 boolCreate(
const string& path)
const;
2111 virtual boolCopy(
const string& new_path, TCopyFlags
flags= fCF_Default,
2112 size_tbuf_size = 0)
const;
2253 static Uint8GetFreeDiskSpace(
const string& path);
2267 static Uint8GetUsedDiskSpace(
const string& path);
2281 static Uint8GetTotalDiskSpace(
const string& path);
2311 voidAdd(
const string& path);
2314 const TList& GetList()
const;
2316 voidSetList(
TList& list);
2334 static voidAdd(
const string& path);
2373 CTmpFile(ERemoveMode remove_file = eRemove);
2403 const string& GetFileName(
void)
const;
2468 static boolIsSupported(
void);
2553 void* GetPtr(
void)
const;
2568 size_tGetSize(
void)
const;
2581 void* GetRealPtr(
void)
const;
2603 size_tGetRealSize(
void)
const;
2612 boolFlush(
void)
const;
2634 voidx_Verify(
void)
const;
2705 Uint8max_file_len = 0);
2745 boolUnmap(
void* ptr);
2752 boolUnmapAll(
void);
2772 size_tGetSize(
void* ptr)
const;
2778 Int8GetFileSize(
void)
const;
2791 boolFlush(
void* ptr)
const;
2811 boolMemMapAdvise(
void* ptr,
EMemMapAdviseadvise)
const;
2906 Uint8max_file_len = 0);
2952 void* Extend(
size_tnew_lendth = 0);
2960 void* GetPtr(
void)
const;
2973 size_tGetSize(
void)
const;
2982 boolFlush(
void)
const;
2998 voidx_Verify(
void)
const;
3031 template<
classTFindFunc>
3033 constvector<string>& masks,
3034 constvector<string>& masks_subdir,
3035TFindFunc& find_func,
3039 if( find_type == 0 ) {
3042unique_ptr<CDir::TEntries>
3044 if(contents.get() ==
NULL) {
3052 if( dir.
GetPath().length() ) {
3057 stringname = dir_entry.
GetPath();
3066 if( (entry_type & find_type) != 0 ) {
3068find_func(dir_entry);
3084 template<
classTFindFunc>
3086 const CMask& masks,
3087 const CMask& masks_subdir,
3088TFindFunc& find_func,
3092 if( find_type == 0 ) {
3095unique_ptr<CDir::TEntries>
3097 if(contents.get() ==
NULL) {
3105 if( dir.
GetPath().length() ) {
3110 stringname = dir_entry.
GetPath();
3114 if( masks.
Match(name, use_case) ) {
3119 if( (entry_type & find_type) != 0 ) {
3121find_func(dir_entry);
3126masks_subdir.
Match(name, use_case) &&
3153 template<
classTPathIterator,
3156TPathIterator path_end,
3157 constvector<string>& masks,
3158TFindFunc& find_func,
3161vector<string> masks_empty;
3162 for(; path_begin != path_end; ++path_begin) {
3163 const string& dir_name = *path_begin;
3171 template<
classTPathIterator,
3174TPathIterator path_end,
3175 constvector<string>& masks,
3176 constvector<string>& masks_subdir,
3177TFindFunc& find_func,
3180 for(; path_begin != path_end; ++path_begin) {
3181 const string& dir_name = *path_begin;
3199 template<
classTPathIterator,
3200 classTMaskIterator,
3203TPathIterator path_end,
3204TMaskIterator mask_begin,
3205TMaskIterator mask_end,
3206TFindFunc& find_func,
3209vector<string> masks;
3210 for(; mask_begin != mask_end; ++mask_begin) {
3211masks.push_back(*mask_begin);
3228 template<
classTPathIterator,
3231TPathIterator path_end,
3232 const CMask& masks,
3233TFindFunc& find_func,
3237 for(; path_begin != path_end; ++path_begin) {
3238 const string& dir_name = *path_begin;
3246 template<
classTPathIterator,
3249TPathIterator path_end,
3250 const CMask& masks,
3251 const CMask& masks_subdir,
3252TFindFunc& find_func,
3255 for(; path_begin != path_end; ++path_begin) {
3256 const string& dir_name = *path_begin;
3265 template<
classTNames>
3287 template<
classTContainer,
classTPathIterator>
3289TPathIterator first_path,
3290TPathIterator last_path,
3291 constvector<string>& masks,
3298 template<
classTContainer,
classTPathIterator>
3300TPathIterator first_path,
3301TPathIterator last_path,
3302 constvector<string>& masks,
3303 constvector<string>& masks_subdir,
3307 FindFiles2(first_path, last_path, masks, masks_subdir, func,
flags);
3318 template<
classTContainer,
classTPathIterator>
3320TPathIterator first_path,
3321TPathIterator last_path,
3322 const CMask& masks,
3329 template<
classTContainer,
classTPathIterator>
3331TPathIterator first_path,
3332TPathIterator last_path,
3333 const CMask& masks,
3334 const CMask& masks_subdir,
3338 FindFiles2(first_path, last_path, masks, masks_subdir, func,
flags);
3349 template<
classTContainer,
classTPathIterator,
classTMaskIterator>
3351TPathIterator first_path,
3352TPathIterator last_path,
3353TMaskIterator first_mask,
3354TMaskIterator last_mask,
3358 FindFiles(first_path, last_path, first_mask, last_mask, func,
flags);
3411 bool operator()(
const string& e1,
const string& e2);
3494 voidOpen(
const string& filename,
EOpenModeopen_mode,
3508 voidCreateTemporary(
const string& dir,
const string& prefix,
3509EAutoRemove auto_remove = eRemoveInClose);
3529 voidFlush(
void)
const;
3545 Uint8GetFilePos(
void)
const;
3548 voidSetFilePos(
Uint8position)
const;
3560 voidSetFilePos(
Int8 offset, EPositionMoveMethod whence)
const;
3566 Uint8GetFileSize(
void)
const;
3585 voidSetFileSize(
Uint8length, EPositionMoveMethod pos = eCurrent)
const;
3595{ m_AutoRemove = auto_remove; }
3654 static IReader* New(
const string& filename,
3687 static IWriter* New(
const string& filename,
3693 size_t* bytes_written = 0);
3731 size_t* bytes_written = 0);
3807fLockNow = (1 << 1),
3808fLockLater = (1 << 2),
3812fAutoUnlock = (1 << 3),
3813fNoAutoUnlock = (1 << 4),
3815fDefault = fLockNow | fAutoUnlock
3872 voidUnlock(
void);
3885 void x_Init(
const char* filename, EType
type, TOffsetType
offset,
size_tlength);
3967 #if !defined(NCBI_OS_MSWIN) 3987 return mask.Match(name, use_case);
3992 size_tbuf_size)
const 4140 return operator()(e1->GetPath(), e2->GetPath());
ncbi::TMaskedQueryRegions mask
CErrnoTemplException â.
Global settings related to the file API.
Base class for CFileIO, CFileReader, CFileWriter, CFileReaderWriter.
Class for support low level input/output for files.
File based IReader/IWriter/IReaderWriter with low level IO for speed.
CFileUtil â Utility functions.
Functor for generic FindFiles, adds file name to the specified container.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
A very basic data-read/write interface.
A very basic data-read interface.
A very basic data-write interface.
Abstract reader-writer interface classes.
std::ofstream out("events_result.xml")
main entry point for tests
static const struct name_t names[]
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
CRange< Position > Map(const CRange< Position > &target, const CRange< Position > &range)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
ENormalizePath
Whether to normalize a path.
EFollowLinks
Whether to follow symbolic links (also known as shortcuts or aliases)
@ eNormalizePath
Normalize a path.
@ eIgnoreLinks
Do not follow symbolic links.
@ eFollowLinks
Follow symbolic links.
string m_File
File to report on.
CException & operator=(const CException &)
Private assignment operator to prohibit assignment.
virtual void x_Init(const CDiagCompileInfo &info, const string &message, const CException *prev_exception, EDiagSev severity)
Helper method for initializing exception data.
virtual const char * GetErrCodeString(void) const override
Translate from the error code value to its string representation.
EErrCode
Error types that an application can generate.
virtual const char * GetType(void) const override
Get class name as a string.
@ eUnknown
Unknown exception.
void operator=(const CFileIO &)
EWho
Which default mode: user, group, or other.
void operator=(const CFileWriter &)
virtual EType GetObjectType(void) const
Get a type of constructed object.
unsigned int TCopyFlags
Binary OR of "ECopyFlags".
void * m_DataPtr
Pointer to the beginning of the mapped area.
EType
Directory entry type.
static string NormalizePath(const string &path, EFollowLinks follow_links=eIgnoreLinks)
Normalize a path.
TEntries GetEntries(const string &mask=kEmptyStr, TGetEntriesFlags flags=0) const
Get directory entries based on the specified "mask".
static string CreateAbsolutePath(const string &path, ERelativeToWhat rtw=eRelativeToCwd)
Get an absolute path from some, possibly relative, path.
void FindFiles2(TPathIterator path_begin, TPathIterator path_end, const vector< string > &masks, const vector< string > &masks_subdir, TFindFunc &find_func, TFindFiles flags=fFF_Default)
virtual void SetDefaultMode(EType entry_type, TMode user_mode, TMode group_mode=fDefault, TMode other_mode=fDefault, TSpecialModeBits special=0)
Set default mode(s) for this entry only.
void operator=(const CFileReaderWriter_Base &)
map< void *, CMemoryFileSegment * > TSegments
CFileReaderWriter_Base(void)
Default constructor.
TOffsetType GetRealOffset(void) const
Get real offset of the mapped area from beginning of file.
TFileHandle m_Handle
System file handle.
EModeRelative
Relative permissions change modes.
TOffsetType GetOffset(void *ptr) const
Get offset of the mapped segment from beginning of the file.
EOpenMode
Memory file open mode.
void operator=(const CMemoryFile &)
void operator=(const CFileReaderWriter &)
CDirEntry CParent
CDirEntry is the parent class.
TSegments m_Segments
Map of pointers to mapped segments.
TRemoveFlags EDirRemoveMode
Directory remove mode.
size_t GetSize(void) const
Get length of the mapped region.
TProcessingFlags TRemoveFlags
Flags based on TProcessingFlags.
int TIfAbsent2
Binary OR of "EIfAbsent2".
TGetEntriesFlags EGetEntriesMode
CFindFileNamesFunc(TNames &names)
void FindFilesInDir(const CDir &dir, const vector< string > &masks, const vector< string > &masks_subdir, TFindFunc &find_func, TFindFiles flags=fFF_Default)
Find files in the specified directory.
long mtime_nsec
Nanoseconds for modification time.
TFlags m_Flags
General flags.
int TGetEntriesFlags
Binary OR of "EGetEntriesFlags".
ERenameFlags
Rename flags.
EFileSystemType fs_type
Type of filesystem.
TOffsetType GetOffset(void) const
Get offset of the mapped area from beginning of the file.
AutoPtr< SLock > m_Lock
Offset and length of the locked area.
unsigned int TCreateFlags
Binary OR of "ECreateFlags".
unsigned int TSpecialModeBits
Bitwise OR of ESpecialModeBits.
EMemMapAdvise
What type of data access pattern will be used for mapped region.
static bool MemMapAdviseAddr(void *addr, size_t len, EMemMapAdvise advise)
Advise on memory map usage for specified region.
void SetAutoClose(bool auto_close=true)
Define whether the open file handle needs to be closed in the destructor.
string GetBase(void) const
Get the base entry name without extension.
unique_ptr< CNcbiIstream > m_InFile
size_t GetSize(void) const
Get length of the mapped area.
unsigned int TMode
Bitwise OR of "EMode".
virtual bool Exists(void) const
Check the entry existence.
unsigned long block_size
Allocation unit (block) size.
ETmpFileCreationMode
Temporary file creation mode.
TMode m_DefaultMode[4]
Holds default mode values.
TOffsetType m_Offset
Requested starting offset of the.
void operator=(const CFileLock &)
virtual EType GetObjectType(void) const
Get a type of constructed object.
unsigned long filename_max
Maximum filename length (part between slashes)
EIfExists
What to do if stream already exists in the AsInputFile/AsOutputFile.
CFile(void)
Default constructor.
unique_ptr< CNcbiOstream > m_OutFile
const CMemoryFileSegment * GetMemoryFileSegment(void *ptr) const
Get pointer to memory mapped file segment by pointer to data.
bool m_CloseHandle
Need to close file handle in destructor.
EIfEmptyPath
What GetDir() should return if the dir entry does not contain path.
TOffsetType GetOffset(void) const
Get offset of the mapped area from beginning of file.
CTmpFile & operator=(const CTmpFile &)
static mode_t MakeModeT(TMode user_mode, TMode group_mode, TMode other_mode, TSpecialModeBits special)
Construct mode_t value from permission modes.
size_t GetRealSize(void) const
Get real length of the mapped area.
void FindFiles(TPathIterator path_begin, TPathIterator path_end, const vector< string > &masks, TFindFunc &find_func, TFindFiles flags=fFF_Default)
Generic algorithm for file search.
EFlags
Flags, used in constructors.
bool MoveToDir(const string &dir, TCopyFlags flags=fRF_Default)
Move the entry to a specified directory.
bool Rename(const string &new_path, TRenameFlags flags=fRF_Default)
Rename entry.
bool MemMapAdvise(EMemMapAdvise advise) const
Advise on memory map usage.
CFileReader(const CFileReader &)
TList m_Paths
List of dir entries for deletion.
NCBI_EXCEPTION_DEFAULT(CFileException, CCoreException)
CDirEntry CParent
CDirEntry is the parent class.
static string MakePath(const string &dir=kEmptyStr, const string &base=kEmptyStr, const string &ext=kEmptyStr)
Assemble a path from basic components.
EIfAbsent
What IsNewer() should do if the dir entry does not exist or is not accessible.
void * m_DataPtrReal
Real pointer to the beginning of the mapped area which should be fried later.
static void SetBackupSuffix(const char *suffix)
Set backup suffix.
EHomeWindows
Windows specific: Historically, we try to use APPDATA% first, and use USERPROFILE% as a fallback to d...
EAccessMode
Which I/O operations permitted on the file.
CFileReaderWriter(const CFileReaderWriter &)
CMemoryFile(const CMemoryFile &)
CDirEntry CParent
CDirEntry is the parent class.
void * GetPtr(void) const
Get pointer to beginning of data.
CTmpFile(const CTmpFile &)
static string AddTrailingPathSeparator(const string &path)
Add trailing path separator, if needed.
EFindFiles
File finding flags.
Uint8 total_space
Total disk space in bytes.
unsigned int TProcessingFlags
Binary OR of "EProcessingFlags".
virtual EType GetObjectType(void) const
Get a type of constructed object.
virtual EType GetObjectType(void) const
Get a type of constructed object.
virtual bool Exists(void) const
Check if directory "dirname" exists.
CDirEntry(void)
Default constructor.
Int8 GetFileSize(void) const
Get length of the mapped file.
TFileHandle GetFileHandle(void) const
Return system file handle associated with the file.
bool IsDir(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a directory.
CErrnoTemplException_Win< CFileException > CFileErrnoException_Base
CDir(void)
Default constructor.
void operator=(const CMemoryFileSegment &)
void operator()(const CDirEntry &dir_entry)
void * GetRealPtr(void) const
Get pointer to beginning of really mapped data.
SCompareDirEntries(ESort s1=ePath)
You can sort by up to 3 path components.
Uint8 free_space
Free disk space in bytes.
size_t GetSize(void *ptr) const
Get length of the mapped segment.
EOpenMode
File open mode.
void x_Verify(void) const
size_t m_Length
Requested length of the mapped area.
EFileSystemType
Unix: The path name to any file/dir withing file system.
unsigned int TRenameFlags
Binary OR of "ERenameFlags".
TNcbiSys_stat orig
Original stat structure.
bool MemMapAdvise(void *ptr, EMemMapAdvise advise) const
Advise on mapped memory map usage.
CMemoryFileSegment * x_GetMemoryFileSegment(void *ptr) const
Get pointer to memory mapped file segment by pointer to data.
string m_FileName
Name of temporary file.
CMemoryFileMap(const CMemoryFileMap &)
TProcessingFlags TSetModeFlags
bool Flush(void) const
Flush by writing all modified copies of memory pages to the underlying file.
bool MemMapAdvise(EMemMapAdvise advise) const
Advise on mapped memory map usage.
bool IsFile(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a file.
CMemoryFileSegment(const CMemoryFileSegment &)
TFileHandle GetFileHandle(void)
Return system file handle.
ERelativeToWhat
How to interpret relative paths.
mode_t GetDefaultModeT(void) const
CSymLink(void)
Default constructor.
void * m_Ptr
Pointer to mapped view of file.
bool operator()(const CDir::TEntry &e1, const CDir::TEntry &e2)
Comparison operators.
EAutoRemove
Controls how temporary file is removed.
void Reset(const string &path)
Reset path string.
ETextBinary
What type of temporary file to create.
TFileHandle GetFileHandle(void)
Return system file handle associated with the file.
bool CopyToDir(const string &dir, TCopyFlags flags=fCF_Default, size_t buf_size=0) const
Copy the entry to a specified directory.
ERemoveMode m_RemoveOnDestruction
Remove file on destruction.
long atime_nsec
Nanoseconds for last access time.
EAutoRemove m_AutoRemove
When (if ever) should the temporary file be removed.
const TList & GetList() const
Get the underlying list.
virtual bool Exists(void) const
Check existence of link.
const string & GetFileName() const noexcept
Shows filename of memory mapped file.
TOffsetType m_OffsetReal
Corrected starting offset of the.
AutoPtr< CDirEntry > TEntry
Define a list of pointers to directory entries.
EMode
Directory entry access permissions.
long ctime_nsec
Nanoseconds for creation time.
void operator=(const CFileReader &)
static const char * m_BackupSuffix
Backup suffix.
CFileReaderWriter_Base(const CFileReaderWriter_Base &)
ECompareText
Mode to compare streams in text form.
ECreateFlags
Flags for Create()/CreatePath()
CFileIO & GetFileIO(void)
Get an underlaying file I/O object.
static bool MatchesMask(const string &name, const string &mask, NStr::ECase use_case=NStr::eCase)
Match a "name" against a simple filename "mask".
string m_FileName
File name.
EMemMapShare
Whether to share changes or not.
static const char * GetBackupSuffix(void)
Get backup suffix.
bool Flush(void *ptr) const
Flush memory mapped file segment.
unsigned int TFlags
Binary OR of "EFlags".
Uint8 used_space
Used disk space in bytes.
void SetList(TList &list)
Set the underlying list.
string m_Path
Full path of this directory entry.
EIfAbsent2
What path version of IsNewer() should do if the dir entry or specified path does not exist or is not ...
string GetName(void) const
Get the base entry name with extension (if any).
bool Flush(void) const
Flush by writing all modified copies of memory pages to the underlying file.
void operator=(const CMemoryFileMap &)
EShareMode
Sharing mode for opened file.
EGetEntriesFlags
Flags for GetEntries()
EType GetType(EFollowLinks follow=eIgnoreLinks) const
Get a type of a directory entry.
int TFindFiles
Bitwise OR of "EFindFiles".
NCBI_EXCEPTION_DEFAULT(CFileErrnoException, CFileErrnoException_Base)
void SetAutoRemove(EAutoRemove auto_remove=eRemoveInClose)
Define whether the temporary file created by CreateTemporary() must be automatically removed in Close...
TEntries * GetEntriesPtr(const string &mask=kEmptyStr, TGetEntriesFlags flags=0) const
Get directory entries based on the specified "mask".
bool m_AutoClose
Need to close file handle in destructor.
void * GetPtr(void) const
Get pointer to beginning of data.
EMemMapProtect
Which operations are permitted in memory map file.
CFileWriter(const CFileWriter &)
const string & GetPathname(void) const
Return file path and name as it was specified in the Open() method or created in CreateTemporary().
string m_Pathname
File path and name.
EPositionMoveMethod
Which starting point to use for the moves of the file pointer.
const string & GetPath(void) const
Get entry path.
bool m_IsLocked
Lock established.
size_t m_LengthReal
Corrected length of the mapped area.
EAllowRead
Which operations to allow on temporary file.
TFileHandle m_Handle
System file handle.
EProcessingFlags
Entries processing flags.
void Add(const string &path)
Add a path for later deletion.
ERemoveMode
What to do with the file on object destruction.
virtual bool Copy(const string &new_path, TCopyFlags flags=fCF_Default, size_t buf_size=0) const
Copy the entry to a location specified by "new_path".
EBackupMode
Backup modes.
string GetExt(void) const
Get extension name.
const HANDLE kInvalidHandle
bool IsLink(void) const
Check whether a directory entry is a symbolic link (alias).
virtual bool Exists(void) const
Check existence of file.
CFileLock(const CFileLock &)
EModeStringFormat
Permission mode string format.
SMemoryFileAttrs * m_Attrs
Specify operations permitted on memory mapped file and mapping mode.
SMemoryFileHandle * m_Handle
Memory file handle.
static void SplitPath(const string &path, string *dir=0, string *base=0, string *ext=0)
Split a path string into its basic components.
@ eSocket
Socket (UNIX only)
@ eBlockSpecial
Block special (UNIX only)
@ eLink
Symbolic link (UNIX only)
@ eCharSpecial
Character special.
@ eOpen
Open existent file, throw exception otherwise.
@ eCreate
Create new file or rewrite existent with zeros.
@ eTmpFileCreate
Create empty file for each GetTmpName* call.
@ eIfExists_Throw
You can make call of AsInputFile/AsOutputFile only once, on each following call throws CFileException...
@ eIfExists_Reset
Delete previous stream and return reference to new object.
@ eIfEmptyPath_Empty
Return empty string.
@ eIfAbsent_Throw
Throw an exception.
@ eIfAbsent_Newer
Deem absent entry to be "newer".
@ eHomeWindows_AppData
Try env var APPDATA% first.
@ eRead
File can be read.
@ eWrite
File can be written.
@ fFF_Recursive
descend into sub-dirs
@ fFF_All
find files and directories (used automatically if fFF_File or fFF_Dir has not specified)
@ fFF_Nocase
case-insensitive name search
@ fFF_Default
default behavior
@ fFF_Dir
find directories
@ ePath
Sort by full path (default)
@ eSELINUX
Security-Enhanced Linux (SELinux)
@ eNTFS
New Technology File System.
@ ePVFS2
Parallel Virtual File System.
@ eFFS
Fast File System (*BSD)
@ eJFFS2
Journalling Flash File System v2.
@ eHFS
Hierarchical File System.
@ eCDFS
ISO 9660 CD-ROM file system (CDFS/ISO9660)
@ eCODA
Coda File System.
@ eFDFS
File Descriptor File System.
@ eJFS
Journalling File System.
@ eExt
Extended file system.
@ eJFFS
Journalling Flash File System.
@ eFAT
Traditional 8.3 MSDOS-style file system.
@ eVxFS
VERITAS File System (VxFS)
@ eGPFS
IBM General Parallel File System.
@ eNFS
Network File System (NFS)
@ eUBIFS
The Unsorted Block Image File System.
@ eSMBFS
Samba File System.
@ eEXOFS
EXtended Object File System (EXOFS)
@ eDebugFS
Debug File System (Linux)
@ eOCFS2
Oracle Cluster File System 2.
@ eMFS
Memory File System.
@ eTMPFS
Virtual Memory File System (TMPFS/SHMFS)
@ eMSFS
Mail Slot File System.
@ eXENIX
Xenix (SysV) file system.
@ eHFSPLUS
Hierarchical File System.
@ eSquashFS
Compressed read-only filesystem (Linux)
@ eV7
UNIX V7 File System.
@ eReiserFS
Reiser File System.
@ eExt2
Second Extended file system.
@ eOPENPROM
/proc/openprom filesystem
@ eHSFS
High Sierra File System.
@ eCacheFS
Cache File System.
@ eBEFS
The Be (BeOS) File System (BeFS)
@ eFUSE
Filesystem in Userspace (FUSE)
@ eHPFS
OS/2 High-Performance File System.
@ ePROC
/proc file system
@ eEFS
The Encrypting File System (EFS) (MSWin)
@ eAUTOFS
Automount File System.
@ eVZFS
Virtuozzo File System (VZFS)
@ eDFS
DCE Distributed File System (DCE/DFS)
@ eFFM
File-on-File Mounting file system.
@ eQNX4
QNX4 file system.
@ eNCPFS
NetWare Core Protocol File System.
@ eSPECFS
SPECial File System.
@ eADFS
Acorn's Advanced Disc Filing System.
@ eUDF
Universal Disk Format.
@ eGFS2
Global File System.
@ eRFS
Remote File Share file system (AT&T RFS)
@ eLOFS
Loopback File System.
@ eDEVFS
Device File System.
@ eFAT32
FAT32 file system.
@ eUSBDEVICE
USBDevice file system.
@ eAFFS
Amiga Fast File System.
@ eExt3
Journalled form of ext2.
@ eUFS2
UNIX File System.
@ eAdvFS
Tru64 UNIX Advanced File System.
@ eFUSE_CTL
Fusectl (helper filesystem for FUSE)
@ eCryptFS
eCryptfs (Enterprise Cryptographic Filesystem)
@ eCRAMFS
Compressed ROMFS.
@ eCIFS
Common Internet File System.
@ eCOH
Coherent (System V)
@ eROMFS
ROM File System.
@ eRelativeToCwd
Relative to the current working directory.
@ eDoNotRemove
Do not ever remove temporary file.
@ eText
Create text file.
@ fDefault
Special flag: ignore all other flags, use current default mode.
@ eMMS_Shared
Changes are shared.
@ eShareWrite
Enables subsequent open operations on the file that request write access.
@ eShareRead
Enables subsequent open operations on the file that request read access.
@ eShare
Combines both eShareRead and eShareWrite modes.
@ fIgnorePath
Return only names of entries, not their full paths.
@ fIgnoreRecursive
Suppress "self recursive" elements (the directories "." and "..").
@ fNoCase
Ignore upper and lower-case differences when doing a mask comparison.
@ eMMP_Write
Data can be written.
@ eMMP_Read
Data can be read.
@ eBegin
Absolute position from beginning of the file.
@ eCurrent
Relative to current position.
@ eAllowRead
Allow read and write.
@ eModeFormat_Symbolic
Shell symbolic format ("u=rwx,g=rwx,o=rx")
@ eModeFormat_Octal
Octal format ("664")
@ eModeFormat_List
Shell list 'ls -l' like format ("rwxrwxrwx")
void Read(CObjectIStream &in, TObjectPtr object, const CTypeRef &type)
void Write(CObjectOStream &out, TConstObjectPtr object, const CTypeRef &type)
@ eRecursive
Recursively.
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
int64_t Int8
8-byte (64-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
ERW_Result
Result codes for I/O operations.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
@ eCompareText_IgnoreEol
Skip end-of-line characters ('\r' and ' ')
@ eCompareText_IgnoreWhiteSpace
static bool MatchesMask(CTempString str, CTempString mask, ECase use_case=eCase)
Match "str" against the "mask".
ECase
Which type of string comparison.
@ eNocase
Case insensitive compare.
@ eCase
Case sensitive compare.
enum ENcbiSwitch ESwitch
Aux.
virtual bool Match(CTempString str, NStr::ECase use_case=NStr::eCase) const =0
Match a string.
#define NCBI_XNCBI_EXPORT
#define INVALID_HANDLE_VALUE
A value for an invalid file handle.
#define HANDLE
An abstraction for a file handle.
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
CBioseq_Base_Info & GetBase(CTSE_Info &tse, const CBioObjectId &id)
const struct ncbi::grid::netcache::search::fields::SIZE size
static void x_Close(SHttpConnector *uuu)
Classes to match a string against a set of masks.
static SERV_ITER x_Open(const char *service, int ismask, TSERV_Type types, unsigned int preferred_host, unsigned short preferred_port, double preference, const SConnNetInfo *net_info, SSERV_InfoCPtr skip[], size_t n_skip, int external, const char *arg, const char *val, SSERV_Info **info, HOST_INFO *host_info)
bool MemoryAdvise(void *addr, size_t len, EMemoryAdvise advise)
[UNIX only] Advise on memory usage for specified memory region.
EMemoryAdvise
Memory advise.
@ eMADV_WillNeed
Expect access in the near future.
@ eMADV_Mergeable
KSM may merge identical pages.
@ eMADV_Normal
No further special treatment â by default.
@ eMADV_Random
Expect random page references.
@ eMADV_DontNeed
Do not expect access in the near future.
@ eMADV_Sequential
Expect sequential page references.
@ eMADV_DoFork
Do inherit across fork() â by default.
@ eMADV_DontFork
Don't inherit across fork()
@ eMADV_Unmergeable
KSM may not merge identical pages â by default.
@ eIfExists_ReturnCurrent
Return reference to current stream, or new if this is first call.
std::istream & in(std::istream &in_, double &x_)
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
struct _stat64 TNcbiSys_stat
Alternate stat structure for use instead of the standard struct stat.
Structure to store information about file system.
Comparator for directory entries names.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4