Bridge++
Version 1.5.4
|
#include <filename.h>
Public Types | |
typedef std::string | keyword_type |
typedef int | value_type |
typedef std::map< keyword_type, value_type > | keyvalue_type |
typedef std::vector< keyword_type > | keywordlist_type |
Public Member Functions | |
Filename (const std::string &base) | |
std::string | format () |
std::string | format (const int v1) |
std::string | format (const int v1, const int v2) |
std::string | format (const int v1, const int v2, const int v3) |
std::string | format (const int v1, const int v2, const int v3, const int v4) |
std::string | format (const int v1, const int v2, const int v3, const int v4, const int v5) |
std::string | format (const int v1, const int v2, const int v3, const int v4, const int v5, const int v6) |
std::string | format (const keyvalue_type &kv) |
Private Member Functions | |
Filename (const Filename &) | |
Filename & | operator= (const Filename &) |
std::string | format_ (int narg,...) |
keywordlist_type | generate_pattern (char *fmt, const size_t fmt_size, const char *msg) |
Private Attributes | |
char | format_str_ [format_str_size_] |
keywordlist_type | keywords_ |
Static Private Attributes | |
static const int | format_str_size_ = 1024 |
Filename utility.
Filename class generates a string by keyword substitution.
usage: Filename filename(format_string);
string fn = filename.format(param1, ...); string fn = filename.format(key_value_map);
format_string contains keywords of a format ${keyword:n} where keyword is an alpha-numeric string ('_' and '.' are also permitted) and an optional number with preceding colon specifies the number of digits (zero padded).
arguments param1, ... to format() are in the order of appearance in the format string. format() also takes key-value map.
[25 March 2015 T.Aoyama]
Definition at line 43 of file filename.h.
typedef std::map<keyword_type, value_type> Filename::keyvalue_type |
Definition at line 48 of file filename.h.
typedef std::string Filename::keyword_type |
Definition at line 46 of file filename.h.
typedef std::vector<keyword_type> Filename::keywordlist_type |
Definition at line 49 of file filename.h.
typedef int Filename::value_type |
Definition at line 47 of file filename.h.
Filename::Filename | ( | const std::string & | base | ) |
Definition at line 24 of file filename.cpp.
|
private |
|
inline |
Definition at line 61 of file filename.h.
|
inline |
Definition at line 66 of file filename.h.
|
inline |
Definition at line 71 of file filename.h.
|
inline |
Definition at line 76 of file filename.h.
|
inline |
Definition at line 81 of file filename.h.
|
inline |
Definition at line 86 of file filename.h.
|
inline |
Definition at line 91 of file filename.h.
std::string Filename::format | ( | const keyvalue_type & | kv | ) |
Definition at line 31 of file filename.cpp.
|
private |
Definition at line 80 of file filename.cpp.
|
private |
Definition at line 98 of file filename.cpp.
|
private |
Definition at line 101 of file filename.h.
|
staticprivate |
Definition at line 100 of file filename.h.
|
private |
Definition at line 103 of file filename.h.