stringbox.h
1 #ifndef SYMENGINE_STRINGBOX_H
2 #define SYMENGINE_STRINGBOX_H
3 
4 #include <string>
5 #include <vector>
6 
7 namespace SymEngine
8 {
9 
10 class StringBox
11 {
12 private:
13  std::vector<std::string> lines_;
14  std::size_t width_;
15 
16  void pad_lines(std::size_t new_width);
17 
18 public:
19  explicit StringBox(std::string s)
20  {
21  lines_.push_back(s);
22  width_ = s.length();
23  }
24 
25  StringBox(std::string s, std::size_t width)
26  {
27  lines_.push_back(s);
28  width_ = width;
29  }
30 
31  StringBox()
32  {
33  width_ = 0;
34  }
35 
36  std::string get_string() const;
37  void add_below(StringBox &other);
38  void add_below_unicode_line(StringBox &other);
39  void add_power(StringBox &other);
40  void enclose_abs();
41  void enclose_parens();
42  void enclose_sqbrackets();
43  void enclose_curlies();
44  void enclose_floor();
45  void enclose_ceiling();
46  void enclose_sqrt();
47  void add_right(StringBox &other);
48  void add_left_parens();
49  void add_right_parens();
50  void add_left_sqbracket();
51  void add_right_sqbracket();
52  void add_left_curly();
53  void add_right_curly();
54 };
55 
56 }; // namespace SymEngine
57 
58 #endif
Main namespace for SymEngine package.
Definition: add.cpp:19