1 #ifndef _TEXTARRAYFORMAT_H_
2 #define _TEXTARRAYFORMAT_H_
10 namespace textarrayformat {
12 class OutOfIndexException : public std::exception
15 OutOfIndexException(const std::string& str);
16 virtual ~OutOfIndexException() throw() {}
18 virtual const char* what() const throw();
21 const std::string str_;
28 TextArrayReader(std::istream& is);
29 virtual ~TextArrayReader() {}
31 // 指定したストリームの先頭からフォーマットに従ってブロック単位
33 // この関数が成功した場合、以前のブロックなどは保存されない。
34 void open(std::istream& is);
37 // 番号を指定しない場合には、最初に取得したブロックが取得される。
38 std::string get(int = 0);
41 const std::vector<std::string>& getBlock() const {return blocks_;}
45 // ファイル中のスプリッタを行ごと退避する。
46 std::string splitter_;
48 // テキストのブロックを退避しておくリスト
49 std::vector<std::string> blocks_;
54 #endif /* _TEXTARRAYFORMAT_H_ */