Leonetienne/Hazelnupp
Simple, easy to use, command line parameter interface
Parameter.h
Go to the documentation of this file.
1 #pragma once
2 #include "Value.h"
3 #include <string>
4 #include <ostream>
5 
6 class Parameter
7 {
8 public:
9  explicit Parameter(const std::string& key, const Value* value);
10  ~Parameter();
11 
13  const std::string& Key() const;
14 
16  const Value* GetValue() const;
17 
18  friend std::ostream& operator<< (std::ostream& os, const Parameter& p)
19  {
20  return os << "{ Key: \"" << p.key << "\" -> " << *p.value << " }";
21  }
22 
23 private:
24  std::string key;
25  ::Value* value;
26 };
Parameter::operator<<
friend std::ostream & operator<<(std::ostream &os, const Parameter &p)
Definition: Parameter.h:18
Value
Abstract class for values.
Definition: Value.h:8
Parameter::~Parameter
~Parameter()
Definition: Parameter.cpp:11
Parameter
Definition: Parameter.h:6
Parameter::Key
const std::string & Key() const
Will return the key of this parameter.
Definition: Parameter.cpp:19
Parameter::GetValue
const Value * GetValue() const
Will return the value of this parameter.
Definition: Parameter.cpp:24
Parameter::Parameter
Parameter(const std::string &key, const Value *value)
Definition: Parameter.cpp:3
Value.h