21 #include <wreport/var.h> 29 struct AttributeList :
public std::vector<std::pair<wreport::Varcode, const char*>>
31 void add(wreport::Varcode code,
const char* value)
33 push_back(std::make_pair(code, value));
37 const char*
get(wreport::Varcode code)
const 39 for (const_iterator i = begin(); i != end(); ++i)
40 if (i->first == code)
return i->second;
48 const char*
pop(wreport::Varcode code)
50 const char* res =
nullptr;
51 for (iterator i = begin(); i != end(); ++i)
60 while (!empty() && back().second ==
nullptr)
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Store a list of attributes to be inserted/updated in the database.
Definition: sql/internals.h:29
const char * pop(wreport::Varcode code)
Get a value by code, returns nullptr if not found, removes it from the AttributeList.
Definition: sql/internals.h:48