diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-07-29 16:21:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-07-29 16:21:13 +0100 |
| commit | 7e9ad089942bc3f1f9b461c87203b515c6d4a237 (patch) | |
| tree | c4af2873e366d2ca59210d74a14f9cfd5e2b42ac /src/name_format.h | |
| parent | 8ef91325f4e565d04493bc05202f8e066b5e3e0c (diff) | |
Simplify NameFormat classes a bit.
Diffstat (limited to 'src/name_format.h')
| -rw-r--r-- | src/name_format.h | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/name_format.h b/src/name_format.h index c2a71280..7eb2713f 100644 --- a/src/name_format.h +++ b/src/name_format.h @@ -43,20 +43,7 @@ namespace dcp { 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 { + std::list<char> components () const { return _components; } @@ -68,7 +55,7 @@ public: _specification = specification; } - typedef std::map<std::string, std::string> Map; + typedef std::map<char, std::string> Map; std::string get (Map) const; @@ -79,12 +66,11 @@ protected: : _specification (specification) {} - void add (std::string name, char placeholder, std::string title); + void add (char placeholder); private: - boost::optional<NameFormat::Component> component_by_placeholder (char p) const; - - std::list<Component> _components; + /** placeholders for each component */ + std::list<char> _components; std::string _specification; }; |
