MCPcopy Create free account
hub / github.com/Cantera/cantera / checkGroupRead

Method checkGroupRead

src/base/Storage.cpp:91–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool Storage::checkGroupRead(const string& id) const
92{
93 vector<string> tokens;
94 tokenizePath(id, tokens);
95 string grp = tokens[0];
96 if (!hasGroup(grp)) {
97 throw CanteraError("Storage::checkGroupRead",
98 "No group with id '{}' found at root.", grp);
99 }
100
101 string path = grp;
102 h5::Group sub = m_file->getGroup(grp);
103 tokens.erase(tokens.begin());
104 for (auto& grp : tokens) {
105 if (!hasGroup(path + "/" + grp)) {
106 throw CanteraError("Storage::checkGroupRead",
107 "No group with id '{}' found at '{}'.", grp, path);
108 }
109 path += "/" + grp;
110 sub = sub.getGroup(grp);
111 }
112 return true;
113}
114
115bool Storage::checkGroupWrite(const string& id, bool permissive)
116{

Callers

nothing calls this directly

Calls 4

tokenizePathFunction · 0.85
CanteraErrorClass · 0.85
eraseMethod · 0.80
beginMethod · 0.45

Tested by

no test coverage detected