MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / load

Method load

src/geode/basic/identifier.cpp:75–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73 }
74
75 void load( std::string_view directory )
76 {
77 const auto filename = absl::StrCat( directory, "/identifier" );
78 std::ifstream file{ filename, std::ifstream::binary };
79 if( !file )
80 {
81 return;
82 }
83 TContext context{};
84 BitseryExtensions::register_deserialize_pcontext(
85 std::get< 0 >( context ) );
86 Deserializer archive{ context, file };
87 archive.object( *this );
88 const auto& adapter = archive.adapter();
89 OpenGeodeBasicException::check_exception(
90 adapter.error() == bitsery::ReaderError::NoError
91 && adapter.isCompletedSuccessfully()
92 && std::get< 1 >( context ).isValid(),
93 nullptr, OpenGeodeException::TYPE::internal,
94 "[Identifier::load] Error while reading file: ", filename );
95 }
96
97 private:
98 static constexpr auto DEFAULT_NAME = "default_name";

Callers 5

current_drift_msMethod · 0.45
generateMethod · 0.45
load_identifierMethod · 0.45
CachedValueMethod · 0.45
CachedValueClass · 0.45

Calls 1

errorMethod · 0.45

Tested by

no test coverage detected