/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
Gaudi::Parsers::PropertyEntry Class Reference

#include <Catalogue.h>

Collaboration diagram for Gaudi::Parsers::PropertyEntry:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PropertyEntry ()
 Constructor.
 PropertyEntry (const std::string &name, const std::string &value)
 Constructor.
 PropertyEntry (const std::string &name, const std::vector< std::string > &value)
 Creator.
 PropertyEntry (const std::string &name, const std::string &value, const Position &pos)
 Constructor.
 PropertyEntry (const std::string &name, const std::vector< std::string > &value, const Position &pos)
 Creator.
const std::string & name (void) const
 Name of property.
void setName (const std::string &name)
 Set name.
std::string value (void) const
 Value of property.
Position position (void) const
 Property position.
bool addValues (const std::vector< std::string > &values)
 Add values to vector value.
bool removeValues (const std::vector< std::string > &values, int &count)
 Remove values from property value.
bool clear (void)
 Clear property vector value.
bool removeEnv ()
 remove environment variables

Private Attributes

std::string m_name
std::vector< std::string > m_value
Position m_position
bool m_isVector

Detailed Description

Definition at line 96 of file Catalogue.h.


Constructor & Destructor Documentation

Gaudi::Parsers::PropertyEntry::PropertyEntry ( ) [inline]

Constructor.

Definition at line 100 of file Catalogue.h.

{}
Gaudi::Parsers::PropertyEntry::PropertyEntry ( const std::string &  name,
const std::string &  value 
)

Constructor.

Parameters:
nameName of property
valueString value of property.

Definition at line 26 of file PropertyEntry.cc.

  : m_name(name),
    m_isVector(false)
{
   m_value.push_back(value);
}
Gaudi::Parsers::PropertyEntry::PropertyEntry ( const std::string &  name,
const std::vector< std::string > &  value 
)

Creator.

Parameters:
nameName of property
valueVector value of property

Definition at line 42 of file PropertyEntry.cc.

  : m_name(name),
    m_value(value),
    m_isVector(true)
{
   if ( 1 == m_value.size() && "" == m_value[0] ) { clear(); }
}
Gaudi::Parsers::PropertyEntry::PropertyEntry ( const std::string &  name,
const std::string &  value,
const Position pos 
)

Constructor.

Parameters:
nameName of property
valueString value of property.
posProperty position in file

Definition at line 60 of file PropertyEntry.cc.

  : m_name(name),
    m_position(pos),
    m_isVector(false)
{
   m_value.push_back(value);
}
Gaudi::Parsers::PropertyEntry::PropertyEntry ( const std::string &  name,
const std::vector< std::string > &  value,
const Position pos 
)

Creator.

Parameters:
nameName of property
valueVector value of property
posProperty position in file

Definition at line 80 of file PropertyEntry.cc.

  : m_name(name),
    m_value(value),
    m_position(pos),
    m_isVector(true)
{
   if ( 1 == m_value.size() && "" == m_value[0] ) { clear(); }
}

Member Function Documentation

const std::string& Gaudi::Parsers::PropertyEntry::name ( void  ) const [inline]

Name of property.

Returns:
Name of property

Definition at line 132 of file Catalogue.h.

{return m_name;};
void Gaudi::Parsers::PropertyEntry::setName ( const std::string &  name) [inline]

Set name.

Definition at line 135 of file Catalogue.h.

std::string Gaudi::Parsers::PropertyEntry::value ( void  ) const

Value of property.

Returns:
Value of property

Definition at line 96 of file PropertyEntry.cc.

{
   std::string result="";
   if(m_isVector){
      result = "[";
      std::string delim="";
      for(std::vector<std::string>::const_iterator cur=m_value.begin();
         cur!=m_value.end();cur++){
            result+=delim+*cur;
            delim=",";
      }
      result+="]";
   }else{
      if(m_value.size()>0){
         result = m_value[0];
        }
   }
   return result;
}
Position Gaudi::Parsers::PropertyEntry::position ( void  ) const [inline]

Property position.

Definition at line 143 of file Catalogue.h.

{return m_position;}  
bool Gaudi::Parsers::PropertyEntry::addValues ( const std::vector< std::string > &  values)

Add values to vector value.

Returns:
true if property value is vector (and we can add values)
Parameters:
valuesValues to add

Definition at line 125 of file PropertyEntry.cc.

{
   if(!m_isVector) return false;
   for(std::vector<std::string>::const_iterator cur = values.begin();
    cur!=values.end();cur++){
      m_value.push_back(*cur);
    }
   return true;   
}
bool Gaudi::Parsers::PropertyEntry::removeValues ( const std::vector< std::string > &  values,
int &  count 
)

Remove values from property value.

Returns:
true if property value is vector (and we can remove values)
Parameters:
values
countCount of removed items

Definition at line 145 of file PropertyEntry.cc.

{
   if(!m_isVector) return false;
   for(std::vector<std::string>::const_iterator
      cur = values.begin();cur!=values.end();cur++){
      std::vector<std::string>::iterator item = std::find(m_value.begin(),
        m_value.end(),*cur);
      if(item!=m_value.end()){
         m_value.erase(item);
         count++;
      }
    }
    return true;
}
bool Gaudi::Parsers::PropertyEntry::clear ( void  )

Clear property vector value.

Returns:
true if property value is vector (and we can clear values)

Definition at line 167 of file PropertyEntry.cc.

{
   if(!m_isVector) return false;
   m_value.clear();
   return true;
}
bool Gaudi::Parsers::PropertyEntry::removeEnv ( )

remove environment variables

Definition at line 176 of file PropertyEntry.cc.

{
  for ( std::vector<std::string>::iterator item = 
          m_value.begin() ; m_value.end() != item ; ++item ) 
  { *item = Gaudi::Parsers::Utils::removeEnvironment ( *item ) ; }
  return true ;
}

Member Data Documentation

Definition at line 171 of file Catalogue.h.

std::vector<std::string> Gaudi::Parsers::PropertyEntry::m_value [private]

Definition at line 172 of file Catalogue.h.

Definition at line 173 of file Catalogue.h.

Definition at line 174 of file Catalogue.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:18 for LafKernel by doxygen 1.7.4