38 #if !defined(NCBI_OS_MSWIN) && !defined(NCBI_OS_UNIX)
39 # error "Class CArchive can be defined on MS-Windows and UNIX platforms only!"
42 #if defined(NCBI_OS_UNIX)
44 # include <sys/types.h>
45 # ifdef NCBI_OS_DARWIN
49 # define makedev makedev
51 # if defined(HAVE_SYS_SYSMACROS_H)
52 # include <sys/sysmacros.h>
54 # if defined (NCBI_OS_IRIX)
55 # include <sys/mkdev.h>
56 # if !defined(major) || !defined(minor) || !defined(makedev)
57 # error "Device macros undefined in this UNIX build!"
63 #define NCBI_USE_ERRCODE_X Util_Compress
78 return (
m_Stat.st_mode & 07777);
96 return major(
m_Stat.st_rdev);
99 if (
sizeof(
int) >= 4 &&
sizeof(
m_Stat.st_rdev) >= 4) {
100 return (*((
unsigned int*) &
m_Stat.st_rdev) >> 16) & 0xFFFF;
103 return (
unsigned int)(-1);
112 return minor(
m_Stat.st_rdev);
115 if (
sizeof(
int) >= 4 &&
sizeof(
m_Stat.st_rdev) >= 4) {
116 return *((
unsigned int*) &
m_Stat.st_rdev) & 0xFFFF;
119 return (
unsigned int)(-1);
159 string user(
info.GetUserName());
163 string group(
info.GetGroupName());
167 return user +
'/' + group;
181 unsigned int major =
info.GetMajor();
182 unsigned int minor =
info.GetMinor();
201 if (
info.GetModificationTime()) {
203 mtime =
t.ToLocalTime().AsString(
"Y-M-D h:m:s");
210 << setw(19) << mtime <<
" "
214 os <<
" -> " <<
info.GetLinkName();
static string s_UserGroupAsString(const CArchiveEntryInfo &info)
static string s_SizeOrMajorMinor(const CArchiveEntryInfo &info)
static string s_MajorMinor(unsigned int n)
static char s_TypeAsChar(CArchiveEntryInfo::EType type)
string m_GroupName
Group name.
bool operator==(const CArchiveEntryInfo &info) const
size_t m_Index
Entry index in the archive.
mode_t GetMode(void) const
CDirEntry::EType m_Type
Type.
string m_LinkName
Link name if type is eLink.
TNcbiSys_stat m_Stat
Direntry-compatible info (as applicable)
ostream & operator<<(ostream &os, const CArchiveEntryInfo &info)
Nice TOC (table of contents) printout.
unsigned int GetMinor(void) const
string m_UserName
User name.
unsigned int GetMajor(void) const
EType
Directory entry type.
unsigned int TSpecialModeBits
Bitwise OR of ESpecialModeBits.
unsigned int TMode
Bitwise OR of "EMode".
static string ModeToString(TMode user_mode, TMode group_mode, TMode other_mode, TSpecialModeBits special, EModeStringFormat format=eModeFormat_Default)
Convert permission modes to string representation using one of predefined formats.
static void ModeFromModeT(mode_t mode, TMode *user_mode, TMode *group_mode=0, TMode *other_mode=0, TSpecialModeBits *special=0)
Convert mode_t to permission mode(s).
@ eBlockSpecial
Block special (UNIX only)
@ eLink
Symbolic link (UNIX only)
@ eCharSpecial
Character special.
@ eModeFormat_List
Shell list 'ls -l' like format ("rwxrwxrwx")
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
static string UInt8ToString(Uint8 value, TNumToStringFlags flags=0, int base=10)
Convert UInt8 to string.
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in util (xutil.lib).