3 #include <snowboy-utils.h>
7 extern std::string global_snowboy_offset_delimiter;
8 extern std::string global_snowboy_string_delimiter;
10 void CheckToken(
const char* token);
11 void EncryptToken(std::string* token);
12 void ExpectOneOrTwoTokens(
bool binary,
const std::string& token1,
const std::string& token2, std::istream* is);
13 void ExpectToken(
bool binary,
const char* token, std::istream* is);
14 void ExpectToken(
bool binary,
const std::string& token, std::istream* is);
15 void ReadToken(
bool binary, std::string* token, std::istream* is);
16 int PeekToken(
bool binary, std::istream* is);
17 void WriteToken(
bool binary,
const char* token, std::ostream* os);
18 void WriteToken(
bool binary,
const std::string& token, std::ostream* os);
20 void ReadBasicType(
bool binary, T* t, std::istream* is);
22 void WriteBasicType(
bool binary, T t, std::ostream* os);
23 void ReadStringVector(
bool binary, std::vector<std::string>* vector, std::istream* is);
24 void ReadStringVectorByLines(
bool binary, std::vector<std::string>* vector, std::istream* is);
26 void ReadIntegerVector(
bool binary, std::vector<T>* data, std::istream* is);
28 void WriteIntegerVector(
bool binary,
const std::vector<T>& data, std::ostream* os);
30 void WriteIntegerVector<int>(
bool binary,
const std::vector<int>& data, std::ostream* os);
33 std::ofstream m_stream;
36 Output(
const std::string& filename,
bool binary);
37 std::ostream* Stream();
42 std::ifstream m_stream;
46 Input(
const std::string& filename);
47 std::istream* Stream();
50 bool is_binary()
const noexcept {
return m_is_binary; }
52 void ParseFilename(
const std::string& filename, std::string* real_name, std::streampos* offset)
const;
Definition: snowboy-io.h:32