Simpatico  v1.10
Str.h
1 #ifndef UTIL_STR_H
2 #define UTIL_STR_H
3 
4 /*
5 * Util Package - C++ Utilities for Scientific Computation
6 *
7 * Copyright 2010 - 2017, The Regents of the University of Minnesota
8 * Distributed under the terms of the GNU General Public License.
9 */
10 
11 #include <iostream>
12 
13 namespace Util
14 {
15 
36  class Str
37  {
38 
39  public:
40 
42 
43 
45  Str();
46 
48  explicit Str(std::string value);
49 
51  Str(std::string value, int width);
52 
54 
56 
57  void setValue(std::string value);
58 
59  void setWidth(int width);
60 
62 
64 
65  std::string value() const;
66 
67  int width() const;
68 
70 
71  private:
72 
73  std::string value_;
74  int width_;
75 
76  //friends:
77 
78  friend std::istream& operator>>(std::istream& in, Str &object);
79  friend std::ostream& operator<<(std::ostream& out, const Str &object);
80 
81  };
82 
90  std::istream& operator>>(std::istream& in, Str &object);
91 
99  std::ostream& operator<<(std::ostream& out, const Str &object);
100 
101 }
102 #endif
friend std::istream & operator>>(std::istream &in, Str &object)
Input stream extractor for an Str object.
Definition: Str.cpp:49
Str()
Default constructor.
Definition: Str.cpp:17
Utility classes for scientific computation.
Definition: accumulators.mod:1
friend std::ostream & operator<<(std::ostream &out, const Str &object)
Output stream inserter for an Str object.
Definition: Str.cpp:58
Wrapper for a std::string, for formatted ostream output.
Definition: Str.h:36