|
| void | Clear () |
| |
| void | Output (int nest, bool span, std::string text) |
| |
| std::string | Print () |
| |
Definition at line 4812 of file mjsonrpc.cxx.
◆ Clear()
| void NestedOutput::Clear |
( |
| ) |
|
|
inline |
Definition at line 4817 of file mjsonrpc.cxx.
4818 {
4820 }
std::vector< NestedLine > fLines
◆ Output()
| void NestedOutput::Output |
( |
int |
nest, |
|
|
bool |
span, |
|
|
std::string |
text |
|
) |
| |
|
inline |
Definition at line 4822 of file mjsonrpc.cxx.
4823 {
4824 if (text.length() < 1)
4825 return;
4826
4832 };
◆ Print()
| std::string NestedOutput::Print |
( |
| ) |
|
|
inline |
Definition at line 4834 of file mjsonrpc.cxx.
4835 {
4836 std::vector<int> tablen;
4837 std::vector<std::string> tab;
4838 std::vector<std::string> tabx;
4839
4840 tablen.push_back(0);
4841 tab.push_back("");
4842 tabx.push_back("");
4843
4844 std::string xtab = "";
4845 int maxlen = 0;
4846 for (
int n=0; ;
n++) {
4847 int len = -1;
4848 for (
unsigned i=0;
i<
fLines.size();
i++) {
4851 if (pp)
4852 continue;
4854 continue;
4855 int l =
fLines[
i].text.length();
4856 if (l>len)
4857 len = l;
4858 }
4859
4860 if (len < 0)
4861 break;
4862 tablen.push_back(len);
4863 tab.push_back(
indent(len,
" ") +
" | ");
4864 xtab +=
indent(len,
" ") +
" | ";
4865 tabx.push_back(xtab);
4866 maxlen += 3+len;
4867 }
4868
4869 std::string s;
4870 int nest = 0;
4871
4872 for (
unsigned i=0;
i<
fLines.size();
i++) {
4875
4876 std::string pad;
4877
4878 if (!p) {
4879 int ipad = tablen[
n+1] -
fLines[
i].text.length();
4881 }
4882
4883 std::string hr =
indent(maxlen-tabx[
n].length(),
"-");
4884
4886 s += std::string(
" | ") +
fLines[
i].text + pad;
4887 else if (
n == nest) {
4888 s += "\n";
4889 if (
n == 0 ||
n == 1)
4890 s += tabx[
n] + hr +
"\n";
4891 s += tabx[
n] +
fLines[
i].text + pad;
4892 } else {
4893 s += "\n";
4894 if (
n == 0 ||
n == 1)
4895 s += tabx[
n] + hr +
"\n";
4896 s += tabx[
n] +
fLines[
i].text + pad;
4897 }
4898
4900 }
4901
4902 return s;
4903 }
static std::string indent(int x, const char *p=" ")
◆ fLines
The documentation for this class was generated from the following file: