eUnsupportedTarFormat:
return "eUnsupportedTarFormat";
131 caseeUnsupportedEntryType:
return "eUnsupportedEntryType";
132 caseeUnsupportedSource:
return "eUnsupportedSource";
133 caseeNameTooLong:
return "eNameTooLong";
134 caseeChecksum:
return "eChecksum";
135 caseeBadName:
return "eBadName";
136 caseeCreate:
return "eCreate";
137 caseeOpen:
return "eOpen";
138 case eRead:
return "eRead";
139 caseeWrite:
return "eWrite";
140 caseeBackup:
return "eBackup";
141 caseeMemory:
return "eMemory";
142 caseeRestoreAttrs:
return "eRestoreAttrs";
189 const string&
GetName(
void)
const{
returnm_Name; }
194{
returnm_Stat.orig.st_mtime; }
196{
CTimemtime(m_Stat.orig.st_mtime);
200{
returnm_Stat.orig.st_atime; }
202{
CTimeatime(m_Stat.orig.st_atime);
206{
returnm_Stat.orig.st_ctime; }
208{
CTimectime(m_Stat.orig.st_ctime);
212{
returnm_Stat.orig.st_size; }
218 unsigned intGetMajor(
void)
const;
219 unsigned intGetMinor(
void)
const;
221{
returnm_Stat.orig.st_uid; }
223{
returnm_Stat.orig.st_gid; }
225{
returnwhich == ePos_Header ? m_Pos : m_Pos + m_HeaderSize; }
228 const string&
GetPath(
void)
const{
returnm_Path; }
232{
return(m_Type ==
info.m_Type &&
233m_Name ==
info.m_Name &&
234m_LinkName ==
info.m_LinkName &&
235m_UserName ==
info.m_UserName &&
236m_GroupName ==
info.m_GroupName &&
237m_HeaderSize ==
info.m_HeaderSize &&
238memcmp(&m_Stat,&
info.m_Stat,
sizeof(m_Stat)) == 0 &&
239m_Pos ==
info.m_Pos ?
true:
false); }
244: m_Type(
eUnknown), m_HeaderSize(0), m_Pos(pos)
245{ memset(&m_Stat, 0,
sizeof(m_Stat)); }
308fIgnoreZeroBlocks = (1<<1),
312fFollowLinks = (1<<2),
318fUpdate = (1<<4) | fOverwrite,
320fBackup = (1<<5) | fOverwrite,
322fEqualTypes = (1<<6),
324fPreserveOwner = (1<<7),
326fPreserveMode = (1<<8),
328fPreserveTime = (1<<9),
330fPreserveAll = fPreserveOwner | fPreserveMode | fPreserveTime,
332fKeepAbsolutePath = (1<<12),
334fSparseUnsupported = (1<<13),
339fSkipUnsupported = (1<<15),
343fIgnoreUnreadable = (1<<17),
345fLongNameSupplement = (1<<18),
348fDumpEntryHeaders = (1<<20),
349fSlowSkipWithRead = (1<<21),
353fIgnoreNameCase = (1<<24),
355fConflictOverwrite = (1<<25),
358fStreamPipeThrough = (1<<28),
360fTarfileNoTruncate = (1<<29),
363fStandardHeaderOnly = (1<<30),
366fDefault = fOverwrite | fPreserveAll
385 CTar(
const string& filename,
size_tblocking_factor = 20);
453unique_ptr<TEntries> Append(
const string& name);
487unique_ptr<TEntries> Update(
const string& name);
511unique_ptr<TEntries> Extract(
void);
520unique_ptr<TEntries> List(
void);
537 TFlagsGetFlags(
void)
const;
543 Uint8GetCurrentPosition(
void)
const;
569 const string& GetBaseDir(
void)
const;
575 voidSetBaseDir(
const string& dirname);
587 static Uint8EstimateArchiveSize(
const TFiles& files,
588 size_tblocking_factor = 20,
629 IReader* GetNextEntryData(
void);
674eList = (1 << 2) | eRO,
675eAppend = (1 << 3) | eRW,
676eUpdate = eList | eAppend,
677eExtract = (1 << 4) | eRO,
678eTest = eList | eExtract,
679eCreate = (1 << 5) | eWO,
680eInternal = (1 << 6) | eRO
705 void x_Open(EAction action);
709 bool x_Flush(
boolnothrow =
false);
712 voidx_Backspace(EAction action);
722 boolx_PackCurrentName(
STarHeader* header,
boollink);
725 voidx_WriteEntryInfo(
const string& name);
728unique_ptr<TEntries> x_ReadAndProcess(EAction action);
733 boolx_ProcessEntry(EAction action,
Uint8 size,
constTEntries*
done);
759 const char* x_ReadArchive (
size_t&
n);
760 voidx_WriteArchive(
size_t n,
const char*
buffer= 0);
763unique_ptr<TEntries> x_Append(
const string& name,
constTEntries* toc = 0);
770 voidx_AppendStream(
const string& name,
CNcbiIstream& is);
773 boolx_AppendFile(
const string&
file);
ncbi::TMaskedQueryRegions mask
User-creatable info for streaming into a tar.
A very basic data-read interface.
bool operator==(const CEquivRange &A, const CEquivRange &B)
static void Test(const char *bind1, SQLSMALLINT type1, const char *bind2, SQLSMALLINT type2)
@ eNoOwnership
No ownership is assumed.
const string & GetPath(void) const
void Create(void)
Create a new empty archive.
void Test(void)
Verify archive integrity.
const size_t m_BufferSize
Buffer(record) size for I/O operations.
string m_GroupName
Group name.
string m_LinkName
Link name if type is e{Sym|Hard}Link.
void x_Close(bool truncate)
const string & GetLinkName(void) const
const string & GetUserName(void) const
bool m_Bad
True if a fatal output error occurred.
CTarEntryInfo m_Current
Current entry being processed.
bool m_Modified
True after at least one write.
Uint8 m_StreamPos
Position in stream (0-based)
void x_Open(EAction action)
EOpenMode
Archive open mode and action.
time_t GetLastAccessTime(void) const
Uint8 GetCurrentPosition(void) const
Get current stream position.
unique_ptr< TEntries > x_Append(const string &name, const TEntries *toc=0)
char * m_Buffer
I/O buffer (page-aligned)
string m_Path
Iff filesystem involved in processing.
EType GetType(void) const
string m_UserName
User name.
pair< string, Uint8 > TFile
Define a list of files with sizes (directories and specials, such as devices, must be given with size...
const string & GetGroupName(void) const
const string & GetBaseDir(void) const
Get base directory to use for files while extracting from/adding to the archive, and in the latter ca...
CNcbiIos & m_Stream
Archive stream (used for all I/O)
Uint8 GetSize(void) const
virtual bool Checkpoint(const CTarEntryInfo &, bool)
Return false to skip the current entry when reading; the return code gets ignored when writing.
ETarModeBits
TTarMode â.
virtual const char * GetErrCodeString(void) const override
Translate from an error code value to its string representation.
CTar & operator=(const CTar &)
TFlags m_Flags
Bitwise OR of flags.
unsigned int GetGroupId(void) const
CTime GetModificationCTime(void) const
list< CTarEntryInfo > TEntries
Define a list of entries.
Uint8 GetPosition(EPos which) const
NCBI_EXCEPTION_DEFAULT(CTarException, CCoreException)
CTime GetCreationCTime(void) const
char * m_BufPtr
Page-unaligned buffer pointer.
EType
Archive entry type.
unsigned int TTarMode
Bitwise OR of ETarModeBits.
time_t GetModificationTime(void) const
CTime GetLastAccessCTime(void) const
const string & GetName(void) const
size_t m_ZeroBlockCount
Zero blocks seen in between entries.
CTarUserEntryInfo(const string &name, Uint8 size)
Uint8 m_Pos
Entry (not data!) position in archive.
unique_ptr< TEntries > List(void)
Get information about all matching archive entries.
void SetFlags(TFlags flags)
Set processing flags.
void Close(void)
Close the archive making sure all pending output is flushed.
string m_Name
Entry name.
EOpenMode m_OpenMode
What was it opened for.
unique_ptr< TEntries > Append(const string &name)
Append an entry at the end of the archive that already exists.
TFlags GetFlags(void) const
Get processing flags.
unsigned int GetUserId(void) const
unsigned int TFlags
Bitwise OR of EFlags.
unique_ptr< TEntries > Update(const string &name)
Look whether more recent copies of the archive members are available in the file system,...
string m_FileName
Tar archive file name (only if file)
CTarEntryInfo(Uint8 pos=0)
string m_BaseDir
Base directory for relative paths.
bool x_Flush(bool nothrow=false)
CDirEntry::SStat m_Stat
Direntry-compatible info.
unique_ptr< TEntries > x_ReadAndProcess(EAction action)
streamsize m_HeaderSize
Total size of all headers for the entry.
EStatus
I/O completion code.
size_t m_BufferPos
Position within the record.
time_t GetCreationTime(void) const
ostream & operator<<(ostream &, const CTarEntryInfo &)
Nice TOC(table of contents) printout.
CNcbiFstream * m_FileStream
File stream of the archive (if file)
@ fTarOWrite
write by other
@ fTarUWrite
write by owner
@ fTarGRead
read by group
@ fTarORead
read by other
@ fTarURead
read by owner
@ fTarGExecute
execute/search by group
@ fTarGWrite
write by group
@ fTarOExecute
execute/search by other
@ fTarSetGID
set GID on execution
@ fTarSetUID
set UID on execution
@ fTarSticky
reserved (sticky bit)
@ fTarUExecute
execute/search by owner
@ eSparseFile
GNU/STAR sparse file.
@ eGNULongName
GNU long name.
@ ePAXHeader
PAX extended header.
@ eVolHeader
Volume header.
virtual void x_Init(const CDiagCompileInfo &info, const string &message, const CException *prev_exception, EDiagSev severity)
Helper method for initializing exception data.
EErrCode
Error types that an application can generate.
TErrCode GetErrCode(void) const
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
unsigned int TSpecialModeBits
Bitwise OR of ESpecialModeBits.
unsigned int TMode
Bitwise OR of "EMode".
TNcbiSys_stat orig
Original stat structure.
@ eSymLink
Symbolic link (UNIX only)
@ eBlockSpecial
Block special (UNIX only)
@ eCharSpecial
Character special.
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.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ios CNcbiIos
Portable alias for ios.
IO_PREFIX::fstream CNcbiFstream
Portable alias for fstream.
ECase
Which type of string comparison.
@ eCase
Case sensitive compare.
void SetNanoSecond(long nanosecond)
Set nanoseconds.
enum ENcbiOwnership EOwnership
Ownership relations between objects.
const struct ncbi::grid::netcache::search::fields::SIZE size
static EIO_Status x_Flush(CONN conn, const STimeout *timeout, int isflush)
static void x_Close(SHttpConnector *uuu)
static const char * x_ReadLine(const char *path, char *line, size_t size)
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)
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
@ eSuccess
Successfully retrieved.
NCBI_XUTIL_EXPORT
Parameter to control printing diagnostic message about conversion of static array data from a differe...
Alternate stat structure for use instead of the standard struct stat.
static DP_BlockInfo * blocks
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