class NameFormat
{
public:
- struct Component
- {
- Component (std::string name_, char placeholder_, std::string title_)
- : name (name_)
- , placeholder (placeholder_)
- , title (title_)
- {}
-
- std::string name;
- char placeholder;
- std::string title;
- };
-
- std::list<Component> components () const {
- return _components;
- }
+ NameFormat () {}
+
+ NameFormat (std::string specification)
+ : _specification (specification)
+ {}
std::string specification () const {
return _specification;
_specification = specification;
}
- typedef std::map<std::string, std::string> Map;
-
- std::string get (Map) const;
+ typedef std::map<char, std::string> Map;
-protected:
- NameFormat () {}
-
- NameFormat (std::string specification)
- : _specification (specification)
- {}
-
- void add (std::string name, char placeholder, std::string title);
+ std::string get (Map, std::string suffix) const;
private:
- boost::optional<NameFormat::Component> component_by_placeholder (char p) const;
-
- std::list<Component> _components;
std::string _specification;
};