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