/usr/include/shogun/io/Parser.h is in libshogun-dev 3.2.0-7.3build4.
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 | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* Written (W) 2013 Evgeniy Andreev (gsomix)
*/
#ifndef __PARSER_H__
#define __PARSER_H__
#include <shogun/lib/SGVector.h>
#include <shogun/lib/Tokenizer.h>
namespace shogun
{
/** @brief Class for reading from a string */
class CParser : public CSGObject
{
public:
/** default constructor */
CParser();
/** constructor
*
* @param string the text to parse
* @param tokenizer tokenizer
*/
CParser(SGVector<char> string, CTokenizer* tokenizer);
/** destructor */
virtual ~CParser();
/** check for next line in the stream
*
* @return true if there is next line, false - otherwise
*/
virtual bool has_next();
/** skip next token */
virtual void skip_token();
/** read string */
virtual SGVector<char> read_string();
/** read zero-terminated string */
virtual SGVector<char> read_cstring();
/** read one of the several base data types. */
//@{
virtual bool read_bool();
virtual char read_char();
virtual uint8_t read_byte();
virtual int16_t read_short();
virtual uint16_t read_word();
virtual int32_t read_int();
virtual uint32_t read_uint();
virtual int64_t read_long();
virtual uint64_t read_ulong();
virtual float32_t read_short_real();
virtual float64_t read_real();
virtual floatmax_t read_long_real();
//@}
/** set tokenizer
*
* @param tokenizer tokenizer
*/
void set_tokenizer(CTokenizer* tokenizer);
/** set the char array that requires tokenization
*
* @param text the text to tokenize
*/
void set_text(SGVector<char> text);
/** @return object name */
virtual const char* get_name() const { return "Parser"; }
private:
/** class initialization */
void init();
private:
/** text to tokenizer */
SGVector<char> m_text;
/** tokenizer */
CTokenizer* m_tokenizer;
};
}
#endif /** __STRING_READER_H__ */
|