Commit ec4ea697 by maarten

versie nummering op de schop

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@376 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent 4918f572
......@@ -216,6 +216,10 @@ class Datablock
void write(std::ostream& os, const vector<string>& order);
void write(std::ostream& os);
// convenience function, add a line to the software category
void add_software(const std::string& name, const std::string& classification,
const std::string& versionNr, const std::string& versionDate);
private:
std::list<Category> mCategories;
......
......@@ -361,6 +361,21 @@ void Datablock::setValidator(Validator* v)
cat.setValidator(v);
}
void Datablock::add_software(const string& name, const string& classification, const string& versionNr, const string& versionDate)
{
Category& cat = operator[]("software");
int ordNr = cat.size() + 1;
// TODO: should we check this ordinal number???
cat.emplace({
{ "pdbx_ordinal", ordNr },
{ "name", name },
{ "version", versionNr },
{ "date", versionDate },
{ "classification", classification }
});
}
void Datablock::getTagOrder(vector<string>& tags) const
{
for (auto& cat: *this)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment