Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Filename Class Reference

Filename utility. More...

#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_typekeywordlist_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 &)
 
Filenameoperator= (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
 

Detailed Description

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.

Member Typedef Documentation

Definition at line 48 of file filename.h.

typedef std::string Filename::keyword_type

Definition at line 46 of file filename.h.

Definition at line 49 of file filename.h.

typedef int Filename::value_type

Definition at line 47 of file filename.h.

Constructor & Destructor Documentation

Filename::Filename ( const std::string &  base)

Definition at line 24 of file filename.cpp.

Filename::Filename ( const Filename )
private

Member Function Documentation

std::string Filename::format ( )
inline

Definition at line 61 of file filename.h.

std::string Filename::format ( const int  v1)
inline

Definition at line 66 of file filename.h.

std::string Filename::format ( const int  v1,
const int  v2 
)
inline

Definition at line 71 of file filename.h.

std::string Filename::format ( const int  v1,
const int  v2,
const int  v3 
)
inline

Definition at line 76 of file filename.h.

std::string Filename::format ( const int  v1,
const int  v2,
const int  v3,
const int  v4 
)
inline

Definition at line 81 of file filename.h.

std::string Filename::format ( const int  v1,
const int  v2,
const int  v3,
const int  v4,
const int  v5 
)
inline

Definition at line 86 of file filename.h.

std::string Filename::format ( const int  v1,
const int  v2,
const int  v3,
const int  v4,
const int  v5,
const int  v6 
)
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.

std::string Filename::format_ ( int  narg,
  ... 
)
private

Definition at line 80 of file filename.cpp.

Filename::keywordlist_type Filename::generate_pattern ( char *  fmt,
const size_t  fmt_size,
const char *  msg 
)
private

Definition at line 98 of file filename.cpp.

Filename& Filename::operator= ( const Filename )
private

Member Data Documentation

char Filename::format_str_[format_str_size_]
private

Definition at line 101 of file filename.h.

const int Filename::format_str_size_ = 1024
staticprivate

Definition at line 100 of file filename.h.

keywordlist_type Filename::keywords_
private

Definition at line 103 of file filename.h.


The documentation for this class was generated from the following files: