strings.cpp
Go to the documentation of this file.
1 
9 /*****************************************************************************
10 ** Includes
11 *****************************************************************************/
12 
13 #include "../../include/ecl/formatters/strings.hpp"
14 
15 /*****************************************************************************
16 ** Namespaces
17 *****************************************************************************/
18 
19 namespace ecl {
20 
21 /*****************************************************************************
22 ** Using
23 *****************************************************************************/
24 
25 using std::string;
26 
27 /*****************************************************************************
28 ** Implementation [Format<string>]
29 *****************************************************************************/
30 
32 {
33  width(w);
34  align(a);
35  return *this;
36 }
37 
38 Format<std::string>& Format<std::string>::operator()(const std::string &input_string)
39 {
40  s = input_string;
41  ready_to_format = true;
42  return *this;
43 }
44 
45 /*****************************************************************************
46 * Implementation [temporary formatting]
47 *****************************************************************************/
48 Format<std::string>& Format<std::string>::operator() (const std::string &input_string, int w)
49 {
50  width(w);
51  s = input_string;
52  ready_to_format = true;
53  return *this;
54 }
55 Format<std::string>& Format<std::string>::operator() (const std::string &input_string, int w, Alignment a)
56 {
57  width(w);
58  align(a);
59  s = input_string;
60  ready_to_format = true;
61  return *this;
62 }
63 
64 }; // namespace ecl
65 
66 
67 
Embedded control libraries.
Formatter for string types.
Definition: strings.hpp:42
Primary template for all formatter classes.
Definition: common.hpp:99
Alignment
Alignment tags for text formatting.
Definition: common.hpp:29


ecl_formatters
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:24