| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Member Functions | Private Attributes

# Gaudi::Parsers::PropertyEntry Class Reference

`#include <Catalogue.h>`

Collaboration diagram for Gaudi::Parsers::PropertyEntry:
[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.
StatusCode | addValues (const std::vector< std::string > &values)
| Add values to vector value.
StatusCode | removeValues (const std::vector< std::string > &values, int &count)
| Remove values from property value.
StatusCode | clear (void)
| Clear property vector value.
StatusCode | 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 98 of file Catalogue.h.

## Constructor & Destructor Documentation

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

Constructor.

Definition at line 102 of file Catalogue.h.

    {}

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

Constructor.

Parameters:

  name | Name of property
  value | String value of property.

Definition at line 26 of file PropertyEntry.cpp.

    {
       m_name = name;
       m_value.push_back(value);
       m_isVector = false;
    }

Gaudi::Parsers::PropertyEntry::PropertyEntry | ( | const std::string & | name,
|  | const std::vector< std::string > & | value
| ) |  |

Creator.

Parameters:

  name | Name of property
  value | Vector value of property

Definition at line 42 of file PropertyEntry.cpp.

    {
       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:

  name | Name of property
  value | String value of property.
  pos | Property position in file

Definition at line 60 of file PropertyEntry.cpp.

    {
       m_name = name;
       m_value.push_back(value);
       m_position = pos;
       m_isVector = false;
    }

Gaudi::Parsers::PropertyEntry::PropertyEntry | ( | const std::string & | name,
|  | const std::vector< std::string > & | value,
|  | const Position & | pos
| ) |  |

Creator.

Parameters:

  name | Name of property
  value | Vector value of property
  pos | Property position in file

Definition at line 80 of file PropertyEntry.cpp.

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

## Member Function Documentation

StatusCode Gaudi::Parsers::PropertyEntry::addValues | ( | const std::vector< std::string > & | values ) |

Add values to vector value.

Returns:
  StatusCode::SUCCESS if property value is vector (and we can add values)

Parameters:

  values | Values to add

Definition at line 125 of file PropertyEntry.cpp.

    {
       if(!m_isVector) return StatusCode::FAILURE;
       for(std::vector<std::string>::const_iterator cur = values.begin();
        cur!=values.end();cur++){
          m_value.push_back(*cur);
        }
       return StatusCode::SUCCESS;
    }

StatusCode Gaudi::Parsers::PropertyEntry::clear | ( | void | ) |

Clear property vector value.

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

Definition at line 167 of file PropertyEntry.cpp.

    {
       if(!m_isVector) return StatusCode::FAILURE;
       m_value.clear();
       return StatusCode::SUCCESS;
    }

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

Name of property.

Returns:
  Name of property

Definition at line 134 of file Catalogue.h.

    {return m_name;};

Position Gaudi::Parsers::PropertyEntry::position | ( | void | ) | const`[inline]`

Property position.

Definition at line 145 of file Catalogue.h.

    {return m_position;}

StatusCode Gaudi::Parsers::PropertyEntry::removeEnv | ( | ) |

remove environment variables

Definition at line 176 of file PropertyEntry.cpp.

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

StatusCode Gaudi::Parsers::PropertyEntry::removeValues | ( | const std::vector< std::string > & | values,
|  | int & | count
| ) |  |

Remove values from property value.

Returns:
  StatusCode::SUCCESS if property value is vector (and we can remove values)

Parameters:

  values |
  count | Count of removed items

Definition at line 145 of file PropertyEntry.cpp.

    {
       if(!m_isVector) return StatusCode::FAILURE;
       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 StatusCode::SUCCESS;
    }

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

Set name.

Definition at line 137 of file Catalogue.h.

    {m_name=name;};

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

Value of property.

Returns:
  Value of property

Definition at line 96 of file PropertyEntry.cpp.

    {
       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;
    }

## Member Data Documentation

bool Gaudi::Parsers::PropertyEntry::m_isVector`[private]`

Definition at line 176 of file Catalogue.h.

std::string Gaudi::Parsers::PropertyEntry::m_name`[private]`

Definition at line 173 of file Catalogue.h.

Position Gaudi::Parsers::PropertyEntry::m_position`[private]`

Definition at line 175 of file Catalogue.h.

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

Definition at line 174 of file Catalogue.h.

The documentation for this class was generated from the following files:

- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiSvc/src/JobOptionsSvc/Catalogue.h
- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiSvc/src/JobOptionsSvc/PropertyEntry.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines