AFLOW
 
Loading...
Searching...
No Matches
aurostd::EmbData Namespace Reference

Functions

 INCBIN (FINDSYM, CMAKE_SOURCE_DIR "DATA/FINDSYM.tar.xz")
 
 INCBIN (FROZSL, CMAKE_SOURCE_DIR "DATA/FROZSL.tar.xz")
 
 INCBIN (PHVASP, CMAKE_SOURCE_DIR "DATA/PHVASP.tar.xz")
 
 INCBIN (ReadMe, CMAKE_SOURCE_DIR "DATA/README.tar.xz")
 
 INCBIN (Test, CMAKE_SOURCE_DIR "DATA/TEST.tar.xz")
 
 INCBIN (Images, CMAKE_SOURCE_DIR "DATA/IMAGES.tar.xz")
 
 INCBIN (Scripts, CMAKE_SOURCE_DIR "DATA/SCRIPTS.tar.xz")
 
 INCBIN (Prototypes, CMAKE_SOURCE_DIR "DATA/PROTO.tar.xz")
 
std::string read_data (struct archive *ar)
 
void write_collection_folder (const std::pair< char *, unsigned int > raw_data, const std::string &path, const std::string &folder_out_raw)
 
void write_collection_file (const std::pair< char *, unsigned int > raw_data, const std::string &filename, const std::string &outfile_raw)
 
std::string get_collection_text (const std::pair< char *, unsigned int > raw_data, const std::string &filename)
 
aurostd::JSON::object get_unit_test ()
 return data for unittests
 
string get_test_file (string file)
 return data for unittests
 
std::string get_content (const std::string &filename, const std::string &collection)
 get the content of an embedded file
 
void save_to_file (const std::string &filename, const std::string &collection, const std::string &target_path)
 write a embedded file into the filesystem
 
void save_to_folder (const std::string &path, const std::string &collection, const std::string &target_path)
 write a embedded file into the filesystem
 
std::string get_test_file (std::string file)
 

Variables

static const std::map< std::string, std::pair< char *, unsigned int > > aflow_data_collections
 

Function Documentation

◆ INCBIN() [1/8]

aurostd::EmbData::INCBIN ( FINDSYM ,
CMAKE_SOURCE_DIR "DATA/FINDSYM.tar.xz"  )

◆ INCBIN() [2/8]

aurostd::EmbData::INCBIN ( FROZSL ,
CMAKE_SOURCE_DIR "DATA/FROZSL.tar.xz"  )

◆ INCBIN() [3/8]

aurostd::EmbData::INCBIN ( PHVASP ,
CMAKE_SOURCE_DIR "DATA/PHVASP.tar.xz"  )

◆ INCBIN() [4/8]

aurostd::EmbData::INCBIN ( ReadMe ,
CMAKE_SOURCE_DIR "DATA/README.tar.xz"  )

◆ INCBIN() [5/8]

aurostd::EmbData::INCBIN ( Test ,
CMAKE_SOURCE_DIR "DATA/TEST.tar.xz"  )

◆ INCBIN() [6/8]

aurostd::EmbData::INCBIN ( Images ,
CMAKE_SOURCE_DIR "DATA/IMAGES.tar.xz"  )

◆ INCBIN() [7/8]

aurostd::EmbData::INCBIN ( Scripts ,
CMAKE_SOURCE_DIR "DATA/SCRIPTS.tar.xz"  )

◆ INCBIN() [8/8]

aurostd::EmbData::INCBIN ( Prototypes ,
CMAKE_SOURCE_DIR "DATA/PROTO.tar.xz"  )

◆ read_data()

std::string aurostd::EmbData::read_data ( struct archive * ar)

Definition at line 58 of file aurostd_data.cpp.

◆ write_collection_folder()

void aurostd::EmbData::write_collection_folder ( const std::pair< char *, unsigned int > raw_data,
const std::string & path,
const std::string & folder_out_raw )

Definition at line 74 of file aurostd_data.cpp.

◆ write_collection_file()

void aurostd::EmbData::write_collection_file ( const std::pair< char *, unsigned int > raw_data,
const std::string & filename,
const std::string & outfile_raw )

Definition at line 133 of file aurostd_data.cpp.

◆ get_collection_text()

std::string aurostd::EmbData::get_collection_text ( const std::pair< char *, unsigned int > raw_data,
const std::string & filename )

Definition at line 184 of file aurostd_data.cpp.

◆ get_unit_test()

JSON::object aurostd::EmbData::get_unit_test ( )

return data for unittests

Returns
content of DATA/TEST/unit_test.json

Definition at line 223 of file aurostd_data.cpp.

◆ get_test_file() [1/2]

string aurostd::EmbData::get_test_file ( string file)

return data for unittests

Returns
content of DATA/TEST/<file>`

Definition at line 229 of file aurostd_data.cpp.

◆ get_content()

std::string aurostd::EmbData::get_content ( const std::string & filename,
const std::string & collection )

get the content of an embedded file

Parameters
filenamename of the file
collectionname of the collection
Returns
content of the embedded file

Definition at line 237 of file aurostd_data.cpp.

◆ save_to_file()

void aurostd::EmbData::save_to_file ( const std::string & filename,
const std::string & collection,
const std::string & target_path )

write a embedded file into the filesystem

Parameters
filenamename of the file (as in the DATA folder)
target_pathtarget location
Authors
20230413 | Hagen Eckert - create function

Definition at line 251 of file aurostd_data.cpp.

◆ save_to_folder()

void aurostd::EmbData::save_to_folder ( const std::string & path,
const std::string & collection,
const std::string & target_path )

write a embedded file into the filesystem

Parameters
pathpath a folder in the archive (must end in '/')
target_pathtarget location
Authors
20240403 | Hagen Eckert - create function

Definition at line 265 of file aurostd_data.cpp.

◆ get_test_file() [2/2]

std::string aurostd::EmbData::get_test_file ( std::string file)

Variable Documentation

◆ aflow_data_collections

const std::map<std::string, std::pair<char *, unsigned int> > aurostd::EmbData::aflow_data_collections
static
Initial value:
= {
{ "README", {(char *) &afdataReadMeData[0], afdataReadMeSize}},
{"FINDSYM", {(char *) &afdataFINDSYMData[0], afdataFINDSYMSize}},
{ "FROZSL", {(char *) &afdataFROZSLData[0], afdataFROZSLSize}},
{ "PHVASP", {(char *) &afdataPHVASPData[0], afdataPHVASPSize}},
{ "TEST", {(char *) &afdataTestData[0], afdataTestSize}},
{ "IMAGES", {(char *) &afdataImagesData[0], afdataImagesSize}},
{"SCRIPTS", {(char *) &afdataScriptsData[0], afdataScriptsSize}},
{ "PROTO", {(char *) &afdataPrototypesData[0], afdataPrototypesSize}},
}

Definition at line 47 of file aurostd_data.cpp.