25#ifndef __XRD_CL_PROPERTY_LIST_HH__
26#define __XRD_CL_PROPERTY_LIST_HH__
51 template<
typename Item>
52 void Set(
const std::string &name,
const Item &value )
64 template<
typename Item>
65 bool Get(
const std::string &name, Item &item )
const
67 PropertyMap::const_iterator it;
71 std::istringstream i; i.str( it->second );
83 template<
typename Item>
84 Item
Get(
const std::string &name )
const
86 PropertyMap::const_iterator it;
90 std::istringstream i; i.str( it->second );
105 template<
typename Item>
106 void Set(
const std::string &name, uint32_t index,
const Item &value )
108 std::ostringstream o;
109 o << name <<
" " << index;
110 Set( o.str(), value );
118 template<
typename Item>
119 bool Get(
const std::string &name, uint32_t index, Item &item )
const
121 std::ostringstream o;
122 o << name <<
" " << index;
123 return Get( o.str(), item );
131 template<
typename Item>
132 Item
Get(
const std::string &name, uint32_t index )
const
134 std::ostringstream o;
135 o << name <<
" " << index;
136 return Get<Item>( o.str() );
152 std::ostringstream o;
153 o << name <<
" " << index;
160 PropertyMap::const_iterator
begin()
const
168 PropertyMap::const_iterator
end()
const
189 inline bool PropertyList::Get<std::string>(
const std::string &name,
190 std::string &item )
const
192 PropertyMap::const_iterator it;
193 it = pProperties.find( name );
194 if( it == pProperties.end() )
201 inline std::string PropertyList::Get<std::string>(
const std::string &name )
const
203 PropertyMap::const_iterator it;
204 it = pProperties.find( name );
205 if( it == pProperties.end() )
206 return std::string();
214 inline void PropertyList::Set<XRootDStatus>(
const std::string &name,
217 std::ostringstream o;
220 Set( name, o.str() );
227 inline bool PropertyList::Get<XRootDStatus>(
const std::string &name,
230 std::string str, msg, tmp;
231 if( !
Get( name, str ) )
234 std::string::size_type i;
236 if( i == std::string::npos )
239 str.erase( i, str.length()-i );
240 std::replace( str.begin(), str.end(),
';',
' ' );
241 std::istringstream is; is.str( str );
242 is >> item.
status;
if( is.bad() )
return false;
243 is >> item.
code;
if( is.bad() )
return false;
244 is >> item.
errNo;
if( is.bad() )
return false;
250 const std::string &name )
const
253 if( !
Get( name, st ) )
262 inline void PropertyList::Set<URL>(
const std::string &name,
272 inline bool PropertyList::Get<URL>(
const std::string &name,
276 if( !
Get( name, tmp ) )
287 inline void PropertyList::Set<std::vector<std::string> >(
288 const std::string &name,
289 const std::vector<std::string> &item )
291 std::vector<std::string>::const_iterator it;
293 for( it = item.begin(); it != item.end(); ++it, ++i )
301 inline bool PropertyList::Get<std::vector<std::string> >(
302 const std::string &name,
303 std::vector<std::string> &item )
const
307 for(
int i = 0; HasProperty( name, i ); ++i )
309 if( !Get( name, i, tmp ) )
311 item.push_back( tmp );
A key-value pair map storing both keys and values as strings.
Definition XrdClPropertyList.hh:41
PropertyMap pProperties
Definition XrdClPropertyList.hh:182
bool Get(const std::string &name, uint32_t index, Item &item) const
Definition XrdClPropertyList.hh:119
Item Get(const std::string &name, uint32_t index) const
Definition XrdClPropertyList.hh:132
void Set(const std::string &name, uint32_t index, const Item &value)
Definition XrdClPropertyList.hh:106
void Set(const std::string &name, const Item &value)
Definition XrdClPropertyList.hh:52
PropertyMap::const_iterator end() const
Get the end iterator.
Definition XrdClPropertyList.hh:168
bool Get(const std::string &name, Item &item) const
Definition XrdClPropertyList.hh:65
std::map< std::string, std::string > PropertyMap
Definition XrdClPropertyList.hh:43
bool HasProperty(const std::string &name) const
Check if we now about the given name.
Definition XrdClPropertyList.hh:142
PropertyMap::const_iterator begin() const
Get the begin iterator.
Definition XrdClPropertyList.hh:160
bool HasProperty(const std::string &name, uint32_t index) const
Check if we know about the given name and index.
Definition XrdClPropertyList.hh:150
void Clear()
Clear the property list.
Definition XrdClPropertyList.hh:176
Item Get(const std::string &name) const
Definition XrdClPropertyList.hh:84
URL representation.
Definition XrdClURL.hh:31
std::string GetURL() const
Get the URL.
Definition XrdClURL.hh:86
Request status.
Definition XrdClXRootDResponses.hh:219
const std::string & GetErrorMessage() const
Get error message.
Definition XrdClXRootDResponses.hh:242
void SetErrorMessage(const std::string &message)
Set the error message.
Definition XrdClXRootDResponses.hh:250
Definition XrdClAction.hh:34
uint16_t code
Error type, or additional hints on what to do.
Definition XrdClStatus.hh:147
uint16_t status
Status of the execution.
Definition XrdClStatus.hh:146
uint32_t errNo
Errno, if any.
Definition XrdClStatus.hh:148