xo-expression2/xo-webutil/src/webutil/Alist.cpp
Roland Conybeare afbc21d143 Add 'xo-webutil/' from commit '8e75838950'
git-subtree-dir: xo-webutil
git-subtree-mainline: 86cd0a812b
git-subtree-split: 8e75838950
2025-05-11 14:48:17 -05:00

28 lines
625 B
C++

/* @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 */