vfs: check userland buffers before reading them.
[haiku.git] / headers / private / shared / TextTable.h
blob3d37e388a9567b231deffe334714639c2cf480c3
1 /*
2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef TEXT_TABLE_H
6 #define TEXT_TABLE_H
9 #include <InterfaceDefs.h>
10 #include <ObjectList.h>
11 #include <StringList.h>
14 namespace BPrivate {
17 class TextTable {
18 public:
19 TextTable();
20 ~TextTable();
22 int32 CountColumns() const;
23 void AddColumn(const BString& title,
24 enum alignment align = B_ALIGN_LEFT,
25 bool canTruncate = false);
27 int32 CountRows() const;
28 BString TextAt(int32 rowIndex, int32 columnIndex) const;
29 void SetTextAt(int32 rowIndex, int32 columnIndex,
30 const BString& text);
32 void Print(int32 maxWidth);
34 private:
35 struct Column;
36 typedef BObjectList<Column> ColumnList;
37 typedef BObjectList<BStringList> RowList;
39 private:
40 ColumnList fColumns;
41 RowList fRows;
45 } // namespace BPrivate
48 using ::BPrivate::TextTable;
51 #endif // TEXT_TABLE_H