refactor: move impl into .cpp + fix include paths
This commit is contained in:
parent
9a23b29c12
commit
38b8f34b28
9 changed files with 123 additions and 50 deletions
28
src/webutil/Alist.cpp
Normal file
28
src/webutil/Alist.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/* @file Alist.cpp */
|
||||
|
||||
#include "Alist.hpp"
|
||||
|
||||
namespace xo {
|
||||
namespace web {
|
||||
/* lookup association by name */
|
||||
std::string_view
|
||||
Alist::lookup(std::string n) const {
|
||||
for (auto const & ix : this->assoc_v_) {
|
||||
if (ix.first == n) {
|
||||
return ix.second;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
} /*lookup*/
|
||||
|
||||
void
|
||||
Alist::push_back(std::string n, std::string v) {
|
||||
this->assoc_v_.push_back(std::make_pair(std::move(n), std::move(v)));
|
||||
}
|
||||
} /*namespace web*/
|
||||
} /*namespace xo*/
|
||||
|
||||
|
||||
|
||||
/* end Alist.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue