MCPcopy Create free account
hub / github.com/alicevision/AliceVision / parseDatabase

Function parseDatabase

src/aliceVision/sensorDB/parseDatabase.cpp:27–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace sensorDB {
26
27bool parseDatabase(const std::string& databaseFilePath, std::vector<Datasheet>& databaseStructure)
28{
29 std::ifstream fileIn(databaseFilePath);
30 if (!fileIn || !utils::exists(databaseFilePath) || !fs::is_regular_file(databaseFilePath))
31 return false;
32
33 std::string line;
34 while (fileIn.good())
35 {
36 getline(fileIn, line);
37 if (!line.empty())
38 {
39 if (line[0] != '#')
40 {
41 std::vector<std::string> values;
42 boost::split(values, line, boost::is_any_of(";"));
43
44 if (values.size() >= 4)
45 {
46 const std::string brand = values[0];
47 const std::string model = values[1];
48 const double sensorWidth = std::stod(values[2]);
49 databaseStructure.emplace_back(brand, model, sensorWidth);
50 }
51 }
52 }
53 }
54 return true;
55}
56
57bool getInfo(const std::string& brand, const std::string& model, const std::vector<Datasheet>& databaseStructure, Datasheet& datasheetContent)
58{

Callers 3

BOOST_AUTO_TEST_CASEFunction · 0.85
KeyframeSelectorMethod · 0.85
aliceVision_mainFunction · 0.85

Calls 3

existsFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68