Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
filename.h
Go to the documentation of this file.
1 
14 #ifndef FILENAME_INCLUDED
15 #define FILENAME_INCLUDED
16 
18 
39 #include <string>
40 #include <map>
41 #include <vector>
42 
43 class Filename
44 {
45  public:
46  typedef std::string keyword_type;
47  typedef int value_type;
48  typedef std::map<keyword_type, value_type> keyvalue_type;
49  typedef std::vector<keyword_type> keywordlist_type;
50 
51  public:
52  Filename(const std::string& base);
53 
54  private:
55  // non-copyable
56  Filename(const Filename&);
57  Filename& operator=(const Filename&);
58 
59  public:
60 
61  std::string format()
62  {
63  return format_(0);
64  }
65 
66  std::string format(const int v1)
67  {
68  return format_(1, v1);
69  }
70 
71  std::string format(const int v1, const int v2)
72  {
73  return format_(2, v1, v2);
74  }
75 
76  std::string format(const int v1, const int v2, const int v3)
77  {
78  return format_(3, v1, v2, v3);
79  }
80 
81  std::string format(const int v1, const int v2, const int v3, const int v4)
82  {
83  return format_(4, v1, v2, v3, v4);
84  }
85 
86  std::string format(const int v1, const int v2, const int v3, const int v4, const int v5)
87  {
88  return format_(5, v1, v2, v3, v4, v5);
89  }
90 
91  std::string format(const int v1, const int v2, const int v3, const int v4, const int v5, const int v6)
92  {
93  return format_(6, v1, v2, v3, v4, v5, v6);
94  }
95 
96  std::string format(const keyvalue_type& kv);
97 
98  private:
99 
100  static const int format_str_size_ = 1024;
102 
104 
105  std::string format_(int narg, ...);
106 
107  keywordlist_type generate_pattern(char *fmt, const size_t fmt_size, const char *msg);
108 };
109 #endif
std::string format()
Definition: filename.h:61
char format_str_[format_str_size_]
Definition: filename.h:101
Filename(const std::string &base)
Definition: filename.cpp:24
static const int format_str_size_
Definition: filename.h:100
std::map< keyword_type, value_type > keyvalue_type
Definition: filename.h:48
std::vector< keyword_type > keywordlist_type
Definition: filename.h:49
std::string format(const int v1)
Definition: filename.h:66
Filename utility.
Definition: filename.h:43
int value_type
Definition: filename.h:47
std::string format(const int v1, const int v2, const int v3, const int v4, const int v5, const int v6)
Definition: filename.h:91
keywordlist_type keywords_
Definition: filename.h:103
Filename & operator=(const Filename &)
std::string format_(int narg,...)
Definition: filename.cpp:80
std::string keyword_type
Definition: filename.h:46
std::string format(const int v1, const int v2, const int v3, const int v4, const int v5)
Definition: filename.h:86
std::string format(const int v1, const int v2)
Definition: filename.h:71
std::string format(const int v1, const int v2, const int v3, const int v4)
Definition: filename.h:81
keywordlist_type generate_pattern(char *fmt, const size_t fmt_size, const char *msg)
Definition: filename.cpp:98
std::string format(const int v1, const int v2, const int v3)
Definition: filename.h:76