xo-alloc/xo-webutil/include/xo/webutil/Alist.hpp
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

33 lines
708 B
C++

/* file Alist.hpp
*
* author: Roland Conybeare, Sep 2022
*/
#pragma once
#include <vector>
#include <string>
#include <string_view>
namespace xo {
namespace web {
/* assocation list, maps strings to strings
* use this for arguments to dynamic-endpoint-callbacks
*/
class Alist {
public:
Alist() = default;
/* lookup association by name */
std::string_view lookup(std::string n) const;
void push_back(std::string n, std::string v);
private:
std::vector<std::pair<std::string, std::string>> assoc_v_;
}; /*Alist*/
} /*namespace web*/
} /*namespace xo*/
/* end Alist.hpp */