JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
IImportSource.h
Go to the documentation of this file.
1 //
2 // Created by Nico on 30/11/2018.
3 //
4 
5 #ifndef JODA_IIMPORTSOURCE_H
6 #define JODA_IIMPORTSOURCE_H
7 
11 
12 namespace joda::docparsing {
17  public:
27  IImportSource(ReaderFlag readerFlag, ParserFlag parserFlag,
28  ContainerFlag containerFlag)
29  : readerFlag(readerFlag),
30  parserFlag(parserFlag),
31  containerFlag(containerFlag) {}
32 
33  virtual ~IImportSource() = default;
34 
35  ReaderFlag getReaderFlag() const { return readerFlag; }
36 
37  ParserFlag getParserFlag() const { return parserFlag; }
38 
39  ContainerFlag getContainerFlag() const { return containerFlag; }
40 
41  virtual void feedSources(
43  &queue,
45  JODA_JSON_FILE_LINESEPERATED_READER_FLAG>::queue_t::ptok_t &ptok) {
46  DCHECK(false) << "Called unimplemented queue "
47  "JODA_JSON_FILE_LINESEPERATED_READER_FLAG";
48  };
49 
50  virtual void feedSources(
53  &ptok) {
54  DCHECK(false)
55  << "Called unimplemented queue JODA_JSON_FILE_BEAUTIFIED_READER_FLAG";
56  };
57 
58  virtual void feedSources(
61  DCHECK(false)
62  << "Called unimplemented queue JODA_JSON_URL_BEAUTIFIED_READER_FLAG";
63  };
64 
70  virtual const std::string toString() = 0;
71 
76  virtual const std::string toQueryString() = 0;
77 
81  virtual size_t estimatedSize() { return 0; }
82 
83  protected:
84  public:
85  private:
86  ReaderFlag readerFlag;
87  ParserFlag parserFlag;
88  ContainerFlag containerFlag;
89 };
90 } // namespace joda::docparsing
91 
92 #endif // JODA_IIMPORTSOURCE_H
ContainerFlag
Definition: ContainerFlags.h:12
ParserFlag
Definition: ParserFlags.h:13
ReaderFlag
Definition: ReaderFlags.h:11
#define JODA_JSON_FILE_LINESEPERATED_READER_FLAG
Definition: ReaderFlags.h:77
Definition: IImportSource.h:16
ContainerFlag getContainerFlag() const
Definition: IImportSource.h:39
virtual void feedSources(JODA_READER_QUEUE< JODA_JSON_URL_READER_FLAG >::queue_t &queue, JODA_READER_QUEUE< JODA_JSON_URL_READER_FLAG >::queue_t::ptok_t &ptok)
Definition: IImportSource.h:58
ParserFlag getParserFlag() const
Definition: IImportSource.h:37
IImportSource(ReaderFlag readerFlag, ParserFlag parserFlag, ContainerFlag containerFlag)
Definition: IImportSource.h:27
virtual ~IImportSource()=default
virtual const std::string toQueryString()=0
virtual void feedSources(JODA_READER_QUEUE< JODA_JSON_FILE_LINESEPERATED_READER_FLAG >::queue_t &queue, JODA_READER_QUEUE< JODA_JSON_FILE_LINESEPERATED_READER_FLAG >::queue_t::ptok_t &ptok)
Definition: IImportSource.h:41
virtual size_t estimatedSize()
Definition: IImportSource.h:81
ReaderFlag getReaderFlag() const
Definition: IImportSource.h:35
virtual const std::string toString()=0
virtual void feedSources(JODA_READER_QUEUE< JODA_JSON_FILE_BEAUTIFIED_READER_FLAG >::queue_t &queue, JODA_READER_QUEUE< JODA_JSON_FILE_BEAUTIFIED_READER_FLAG >::queue_t::ptok_t &ptok)
Definition: IImportSource.h:50
Definition: IImportSource.h:12
Definition: ReaderFlags.h:88