/usr/include/bobcat/table is in libbobcat-dev 3.23.01-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | #ifndef INCLUDED_BOBCAT_TABLE_
#define INCLUDED_BOBCAT_TABLE_
#include <sstream>
#include <bobcat/tablebase>
namespace FBB
{
class Table: public TableBase, public std::ostringstream
{
template <typename Type>
friend Table &operator<<(Table &table, Type const &ref);
public:
typedef std::string value_type; // for C++-0x
typedef Element const &const_reference; // required for push_back()
Table(size_t nColumns, FillDirection direction, // 0
WidthType widthType = COLUMNWIDTH);
Table(TableSupport &tableSupport, // 1
size_t nColumns, FillDirection direction,
WidthType widthType = COLUMNWIDTH);
Table(Table const &other) = delete;
Table &operator=(Table const &other) = delete;
Table &append(std::string const &str, char const *sep = " \t",
bool addEmpty = false);
template <typename InputIterator>
void fill(InputIterator begin, InputIterator end); // .f
void push_back(Element const &element); // add an element to .f
// the table, using the
// default alignment.
Table &setAlign(Align const &align); // set an alignment .f
Table &def(); // fillup an incomplete table .f
// automatically at insertions
using TableBase::clear;
void clearStr(); // clear the ostringstream part .f
private:
Table &flush(); // insert the text currently
// inserted into the Table object
// as ostringstream into the table
};
inline void Table::clearStr()
{
std::ostringstream::clear();
}
inline Table &Table::def()
{
TableBase::def();
return *this;
}
template <typename Iter>
void Table::fill(Iter it, Iter end)
{
TableBase::clear();
while (it != end)
{
std::ostringstream str;
str << *it++;
push_back(str.str());
}
}
inline void Table::push_back(Element const &element)
{
d_tabulated = false;
d_string.push_back(element);
}
inline Table &Table::setAlign(Align const &align)
{
TableBase::setAlign(align);
return *this;
}
// Free Functions
// Insert column or element alignments
inline Table &operator<<(Table &tab, Align const &align)
{
return tab.setAlign(align);
}
inline Table &def(Table &table)
{
return table.def();
}
// For def
inline Table &operator<<(Table &table, Table &(*fun)(Table &))
{
return (*fun)(table);
}
// Insert any other insertable type into a Table
template <typename Type> // Insert any other insertable type into a Table
Table &operator<<(Table &table, Type const &ref)
{
reinterpret_cast<std::ostringstream &>(table) << ref;
return table.flush();
}
} // FBB
#endif
|