|
NGen
|
Classes | |
| struct | Identified |
| The result of identifying a hydrofabric: which one it is, and any database opened to find out. More... | |
Functions | |
| bool | is_sqlite_file (const std::string &path) |
Whether path holds a SQLite database, which for a hydrofabric means a GeoPackage. | |
| Identified | identify (const std::string &catchment_path, const std::string &nexus_path) |
Identify the hydrofabric catchment_path and nexus_path name. | |
Variables | |
| const char | SQLITE_MAGIC [] = "SQLite format 3" |
| Every SQLite database begins with this, trailing NUL included. | |
| Identified ngen::hydrofabric::anonymous_namespace{HydrofabricReaderFactory.cpp}::identify | ( | const std::string & | catchment_path, |
| const std::string & | nexus_path ) |
Identify the hydrofabric catchment_path and nexus_path name.
| [in] | catchment_path | Path to the file holding the divides |
| [in] | nexus_path | Path to the file holding the nexuses; may be the same file |
| std::runtime_error | if the paths name different formats, if a GeoPackage cannot be opened or matches no known release, or if the paths name GeoPackages and GeoPackage support was not built in |
References ngen::geopackage::GeoPackageReader::db(), ngen::hydrofabric::detect_hydrofabric(), identify(), is_sqlite_file(), ngen::geopackage::make_reader(), ngen::hydrofabric::V1_GEOJSON, and ngen::hydrofabric::anonymous_namespace{HydrofabricReaderFactory.cpp}::Identified::version.
Referenced by identify().
| bool ngen::hydrofabric::anonymous_namespace{HydrofabricReaderFactory.cpp}::is_sqlite_file | ( | const std::string & | path | ) |
Whether path holds a SQLite database, which for a hydrofabric means a GeoPackage.
Detect whether this is a SQLite database file by reading the beginning of the file, rather than simply reading the file name. This probably means, if we assume it is a hydrofabric, that it is a GeoPackage hydrofabric (versus something else like a GeoJson hydrofabric), though specific validity checks of that nature are the responsibility of something else.
| [in] | path | Hydrofabric data path |
| std::runtime_error | if the file cannot be opened for reading |
References is_sqlite_file(), and SQLITE_MAGIC.
Referenced by identify(), and is_sqlite_file().
| const char ngen::hydrofabric::anonymous_namespace{HydrofabricReaderFactory.cpp}::SQLITE_MAGIC[] = "SQLite format 3" |
Every SQLite database begins with this, trailing NUL included.
Referenced by is_sqlite_file().