PhoenixFileParser  1.5.1
Set of tools to ease file parsing
Loading...
Searching...
No Matches
ConfigNodeIter.h
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7#ifndef __CONFIGNODEITER_H__
8#define __CONFIGNODEITER_H__
9
10#include "configCheckValue.h"
11#include "ConfigCheck.h"
12
13#include "ConfigNode.h"
14
17 public:
18 friend ConfigNode;
19 ConfigNodeIter(const ConfigNodeIter & other);
20 virtual ~ConfigNodeIter();
22
24
25 std::ostream * getOut();
26 void up();
27 bool down(const PString & childName);
28 bool isWriteMode() const;
29
30 template<typename T>
31 bool getValue(T & data) const;
32 template<typename T>
33 bool getValue(T & data, const GenericConfigCheck * checker) const;
34
35 template<typename T>
36 bool getChildValue(const PString & childName, T & data, const GenericConfigCheck * checker = NULL);
37
38 protected:
39 void copyConfigNodeIter(const ConfigNodeIter & other);
40
41 private:
42 ConfigNodeIter(const ConfigNode * current, std::ostream * out, bool isWriteMode);
44
48 std::ostream * p_out;
51};
52
53#include "ConfigNodeIter_impl.h"
54
55#endif
56
bool getChildValue(const PString &childName, T &data, const GenericConfigCheck *checker=NULL)
Get a value from the current ConfigNode and check data.
bool p_isWriteMode
True if the ConfigNodeIter is in writing mode.
bool down(const PString &childName)
Move to the child of the current node.
void up()
Move to the parent of the current node.
bool getValue(T &data) const
Get a value from the current ConfigNode.
ConfigNode * p_current
Current ConfigNode.
ConfigNodeIter & operator=(const ConfigNodeIter &other)
Definition of equal operator of ConfigNodeIter.
bool isWriteMode() const
Say if the iterator is in write mode.
ConfigNodeIter(const ConfigNodeIter &other)
Copy constructor of ConfigNodeIter.
ConfigNode * operator->()
Get the current ConfigNode.
virtual ~ConfigNodeIter()
Destructor of ConfigNodeIter.
std::ostream * p_out
std::ostream to be used for the error messages
void copyConfigNodeIter(const ConfigNodeIter &other)
Copy function of ConfigNodeIter.
std::ostream * getOut()
Get the pointer of the output stream.
void initialisationConfigNodeIter()
Initialisation function of the class ConfigNodeIter.
Generic class for a configuration check.