7#ifndef MESSAGE_DICTIONARY_H
8#define MESSAGE_DICTIONARY_H
15#include <boost/lexical_cast.hpp>
16#include <boost/shared_ptr.hpp>
24class MessageDictionary;
69 virtual bool add(
const MessageID& ident,
const std::string& text) {
70 return (
add(boost::lexical_cast<std::string>(ident), text));
82 virtual bool add (
const std::string& ident,
const std::string& text);
96 return (
replace(boost::lexical_cast<std::string>(ident), text));
108 virtual bool replace(
const std::string& ident,
const std::string& text);
128 virtual bool erase(
const std::string& ident,
const std::string& text);
145 virtual std::vector<std::string>
load(
const char* elements[]);
157 return(
getText(boost::lexical_cast<std::string>(ident)));
170 virtual const std::string&
getText(
const std::string& ident)
const;
177 return (dictionary_.size());
183 return (dictionary_.begin());
189 return (dictionary_.end());
202 const std::string empty_;
MessageDictionary()
Constructor.
virtual bool replace(const MessageID &ident, const std::string &text)
Replace Message.
static const MessageDictionaryPtr & globalDictionary()
Return Global Dictionary.
virtual const std::string & getText(const MessageID &ident) const
Get Message Text.
virtual std::vector< std::string > load(const char *elements[])
Load Dictionary.
const_iterator end() const
Return end() iterator of internal map.
virtual size_t size() const
Number of Items in Dictionary.
std::map< std::string, std::string > Dictionary
virtual bool erase(const std::string &ident, const std::string &text)
Removes the specified message from the dictionary.
const_iterator begin() const
Return begin() iterator of internal map.
Dictionary::const_iterator const_iterator
virtual ~MessageDictionary()
Virtual Destructor.
virtual bool add(const MessageID &ident, const std::string &text)
Add Message.
boost::shared_ptr< MessageDictionary > MessageDictionaryPtr
Shared pointer to the MessageDictionary.
Defines the logger used by the top-level component of kea-lfc.