XRootD
Loading...
Searching...
No Matches
XrdCl::StatInfoImpl Struct Reference
+ Collaboration diagram for XrdCl::StatInfoImpl:

Public Member Functions

 StatInfoImpl ()
 
 StatInfoImpl (const StatInfoImpl &pimpl)
 
bool ParseServerResponse (const char *data)
 

Public Attributes

uint64_t pAccessTime
 
uint64_t pChangeTime
 
std::string pCksum
 
bool pExtended
 
uint32_t pFlags
 
std::string pGroup
 
bool pHasCksum
 
std::string pId
 
std::string pMode
 
uint64_t pModifyTime
 
std::string pOwner
 
uint64_t pSize
 

Detailed Description

Definition at line 109 of file XrdClXRootDResponses.cc.

Constructor & Destructor Documentation

◆ StatInfoImpl() [1/2]

XrdCl::StatInfoImpl::StatInfoImpl ( )
inline

◆ StatInfoImpl() [2/2]

XrdCl::StatInfoImpl::StatInfoImpl ( const StatInfoImpl pimpl)
inline

Definition at line 117 of file XrdClXRootDResponses.cc.

117 : pId( pimpl.pId ),
118 pSize( pimpl.pSize ),
119 pFlags( pimpl.pFlags ),
120 pModifyTime( pimpl.pModifyTime ),
121 pChangeTime( pimpl.pChangeTime ),
122 pAccessTime( pimpl.pAccessTime ),
123 pMode( pimpl.pMode ),
124 pOwner( pimpl.pOwner ),
125 pGroup( pimpl.pGroup ),
126 pExtended( pimpl.pExtended ),
127 pHasCksum( pimpl.pHasCksum )
128 {
129 }

Member Function Documentation

◆ ParseServerResponse()

bool XrdCl::StatInfoImpl::ParseServerResponse ( const char *  data)
inline

Definition at line 134 of file XrdClXRootDResponses.cc.

135 {
136 if( !data || strlen( data ) == 0 )
137 return false;
138
139 std::vector<std::string> chunks;
140 Utils::splitString( chunks, data, " " );
141
142 if( chunks.size() < 4 )
143 return false;
144
145 pId = chunks[0];
146
147 char *result;
148 pSize = ::strtoll( chunks[1].c_str(), &result, 0 );
149 if( *result != 0 )
150 {
151 pSize = 0;
152 return false;
153 }
154
155 pFlags = ::strtol( chunks[2].c_str(), &result, 0 );
156 if( *result != 0 )
157 {
158 pFlags = 0;
159 return false;
160 }
161
162 pModifyTime = ::strtoll( chunks[3].c_str(), &result, 0 );
163 if( *result != 0 )
164 {
165 pModifyTime = 0;
166 return false;
167 }
168
169 if( chunks.size() >= 9 )
170 {
171 pChangeTime = ::strtoll( chunks[4].c_str(), &result, 0 );
172 if( *result != 0 )
173 {
174 pChangeTime = 0;
175 return false;
176 }
177
178 pAccessTime = ::strtoll( chunks[5].c_str(), &result, 0 );
179 if( *result != 0 )
180 {
181 pAccessTime = 0;
182 return false;
183 }
184
185 // we are expecting at least 4 characters, e.g.: 0644
186 if( chunks[6].size() < 4 ) return false;
187 pMode = chunks[6];
188
189 pOwner = chunks[7];
190 pGroup = chunks[8];
191
192 pExtended = true;
193 }
194
195 // after the extended stat information, we might have the checksum
196 if( chunks.size() >= 10 )
197 {
198 if( ( chunks[9] == "[" ) && ( chunks[11] == "]" ) )
199 {
200 pHasCksum = true;
201 pCksum = chunks[10];
202 }
203 }
204
205 return true;
206 }
static void splitString(Container &result, const std::string &input, const std::string &delimiter)
Split a string.
Definition XrdClUtils.hh:56

References pAccessTime, pChangeTime, pCksum, pExtended, pFlags, pGroup, pHasCksum, pId, pMode, pModifyTime, pOwner, pSize, and XrdCl::Utils::splitString().

+ Here is the call graph for this function:

Member Data Documentation

◆ pAccessTime

uint64_t XrdCl::StatInfoImpl::pAccessTime

Definition at line 213 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pChangeTime

uint64_t XrdCl::StatInfoImpl::pChangeTime

Definition at line 212 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pCksum

std::string XrdCl::StatInfoImpl::pCksum

Definition at line 220 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pExtended

bool XrdCl::StatInfoImpl::pExtended

Definition at line 218 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pFlags

uint32_t XrdCl::StatInfoImpl::pFlags

Definition at line 210 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pGroup

std::string XrdCl::StatInfoImpl::pGroup

Definition at line 216 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pHasCksum

bool XrdCl::StatInfoImpl::pHasCksum

Definition at line 219 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pId

std::string XrdCl::StatInfoImpl::pId

Definition at line 208 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pMode

std::string XrdCl::StatInfoImpl::pMode

Definition at line 214 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pModifyTime

uint64_t XrdCl::StatInfoImpl::pModifyTime

Definition at line 211 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pOwner

std::string XrdCl::StatInfoImpl::pOwner

Definition at line 215 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().

◆ pSize

uint64_t XrdCl::StatInfoImpl::pSize

Definition at line 209 of file XrdClXRootDResponses.cc.

Referenced by ParseServerResponse().


The documentation for this struct was generated from the following file: