souffle  2.0.2-371-g6315b36
Public Member Functions | Static Protected Member Functions | Protected Attributes
souffle::ReadFileJSON Class Reference

#include <ReadStreamJSON.h>

Inheritance diagram for souffle::ReadFileJSON:
Inheritance graph
Collaboration diagram for souffle::ReadFileJSON:
Collaboration graph

Public Member Functions

 ReadFileJSON (const std::map< std::string, std::string > &rwOperation, SymbolTable &symbolTable, RecordTable &recordTable)
 
 ~ReadFileJSON () override=default
 
- Public Member Functions inherited from souffle::ReadStreamJSON
 ReadStreamJSON (std::istream &file, const std::map< std::string, std::string > &rwOperation, SymbolTable &symbolTable, RecordTable &recordTable)
 
- Public Member Functions inherited from souffle::ReadStream
template<typename T >
void readAll (T &relation)
 
- Public Member Functions inherited from souffle::SerialisationStream< false >
virtual ~SerialisationStream ()=default
 

Static Protected Member Functions

static std::string getFileName (const std::map< std::string, std::string > &rwOperation)
 Return given filename or construct from relation name. More...
 

Protected Attributes

std::string baseName
 
std::ifstream fileHandle
 
- Protected Attributes inherited from souffle::ReadStreamJSON
std::istream & file
 
bool isInitialized
 
Json jsonSource
 
std::map< const std::string, const size_t > paramIndex
 
Json params
 
size_t pos
 
bool useObjects
 
- Protected Attributes inherited from souffle::SerialisationStream< false >
size_t arity
 
size_t auxiliaryArity
 
RO< RecordTable > & recordTable
 
RO< SymbolTable > & symbolTable
 
std::vector< std::string > typeAttributes
 
Json types
 

Additional Inherited Members

- Protected Types inherited from souffle::SerialisationStream< false >
using RO = std::conditional_t< readOnlyTables, const A, A >
 
- Protected Member Functions inherited from souffle::ReadStreamJSON
RamDomain readNextElementList (const Json &source, const std::string &recordTypeName)
 
RamDomain readNextElementObject (const Json &source, const std::string &recordTypeName)
 
Own< RamDomain[]> readNextTuple () override
 
Own< RamDomain[]> readNextTupleList ()
 
Own< RamDomain[]> readNextTupleObject ()
 
- Protected Member Functions inherited from souffle::ReadStream
void consumeChar (const std::string &str, char c, size_t &pos)
 Read past given character, consuming any preceding whitespace. More...
 
void consumeWhiteSpace (const std::string &str, size_t &pos)
 Advance position in the string until first non-whitespace character. More...
 
RamDomain readADT (const std::string &source, const std::string &adtName, size_t pos=0, size_t *charactersRead=nullptr)
 
std::string readAlphanumeric (const std::string &source, size_t &pos)
 Read the next alphanumeric sequence (corresponding to IDENT). More...
 
RamDomain readRecord (const std::string &source, const std::string &recordTypeName, size_t pos=0, size_t *charactersRead=nullptr)
 Read a record from a string. More...
 
 ReadStream (const std::map< std::string, std::string > &rwOperation, SymbolTable &symTab, RecordTable &recTab)
 
std::string readUntil (const std::string &source, const std::string stopChars, const size_t pos, size_t *charactersRead)
 
- Protected Member Functions inherited from souffle::SerialisationStream< false >
 SerialisationStream (RO< SymbolTable > &symTab, RO< RecordTable > &recTab, const std::map< std::string, std::string > &rwOperation)
 
 SerialisationStream (RO< SymbolTable > &symTab, RO< RecordTable > &recTab, Json types)
 
 SerialisationStream (RO< SymbolTable > &symTab, RO< RecordTable > &recTab, Json types, std::vector< std::string > relTypes, size_t auxArity=0)
 

Detailed Description

Definition at line 310 of file ReadStreamJSON.h.

Constructor & Destructor Documentation

◆ ReadFileJSON()

souffle::ReadFileJSON::ReadFileJSON ( const std::map< std::string, std::string > &  rwOperation,
SymbolTable symbolTable,
RecordTable recordTable 
)
inline

Definition at line 312 of file ReadStreamJSON.h.

312  {
313  if (!fileHandle.is_open()) {
314  throw std::invalid_argument("Cannot open json file " + baseName + "\n");
315  }
316  }
317 
318  ~ReadFileJSON() override = default;
319 
320 protected:

References baseName, and fileHandle.

◆ ~ReadFileJSON()

souffle::ReadFileJSON::~ReadFileJSON ( )
overridedefault

Member Function Documentation

◆ getFileName()

static std::string souffle::ReadFileJSON::getFileName ( const std::map< std::string, std::string > &  rwOperation)
inlinestaticprotected

Return given filename or construct from relation name.

Default name is [configured path]/[relation name].json

Parameters
rwOperationmap of IO configuration options
Returns
input filename

Definition at line 332 of file ReadStreamJSON.h.

340  : public ReadStreamFactory {

Field Documentation

◆ baseName

std::string souffle::ReadFileJSON::baseName
protected

Definition at line 340 of file ReadStreamJSON.h.

Referenced by ReadFileJSON().

◆ fileHandle

std::ifstream souffle::ReadFileJSON::fileHandle
protected

Definition at line 341 of file ReadStreamJSON.h.

Referenced by ReadFileJSON().


The documentation for this class was generated from the following file:
souffle::ReadFileJSON::~ReadFileJSON
~ReadFileJSON() override=default
souffle::ReadFileJSON::baseName
std::string baseName
Definition: ReadStreamJSON.h:340
souffle::ReadFileJSON::fileHandle
std::ifstream fileHandle
Definition: ReadStreamJSON.h:341