39#ifndef DRAIN_CLASS_XML
40#define DRAIN_CLASS_XML
42#include <drain/Enum.h>
48#include "ReferenceMap.h"
49#include "TreeUnordered.h"
81 ClassXML(
const std::string & arg=
""){
125 void set(
const char *arg){
129 void set(
const std::string & arg){
141 template <
typename T>
142 void set(
const T & arg);
146 const std::string & str()
const {
151 const std::string & strPrefixed()
const {
163 std::string prefixed;
169std::ostream & operator<<(std::ostream &ostr,
const ClassXML & cls){
188#define DRAIN_ENUM_CLASSXML(enumtype) template <> inline void ClassXML::set(const enumtype & arg){ assign(drain::Enum<enumtype>::dict.getKey(arg));}
200 template <
typename ... TT>
207 template <
typename ... TT>
209 void add(
const std::string & arg,
const TT &... args) {
217 template <
typename ... TT>
219 void add(
const char *arg,
const TT &... args) {
220 add(std::string(arg), args...);
224 template <
typename ... TT>
240 template <
typename T,
typename ...TT>
242 void add(
const T & arg,
const TT &... args) {
281 template <
typename T,
typename ...TT>
283 bool has(
const T & arg)
const {
284 return (retrieve(arg) != end());
288 template <
typename T,
typename ...TT>
290 bool hasAny(
const T & arg,
const TT &... args)
const {
291 return has(arg) || hasAny(args...);
323 template <
typename E>
325 void remove(
const E & arg){
326 iterator it = retrieve(arg);
342 iterator retrieve(
const std::string & arg)
const {
347 iterator retrieve(
const char *arg)
const {
352 iterator retrieve(
const ClassXML & arg)
const {
356 template <
typename E>
358 iterator retrieve(
const E & arg)
const {
363 bool hasAny()
const {
370std::ostream &
operator<<(std::ostream &ostr,
const ClassListXML & cls){
Container for style classes. Essentially a set of strings, with space-separated output support.
Definition ClassXML.h:196
void add(const T &arg, const TT &... args)
Add one or several classes.
Definition ClassXML.h:242
void add(const std::string &arg, const TT &... args)
Add one or several classes.
Definition ClassXML.h:209
void add(const char *arg, const TT &... args)
Add one or several classes.
Definition ClassXML.h:219
static const SprinterLayout layout
Uses spaces as separators.
Definition ClassXML.h:334
void add(const ClassXML &arg, const TT &... args)
Add one or several classes.
Definition ClassXML.h:226
A wrapper marking string an CSS effect.
Definition ClassXML.h:57
static std::ostream & sequenceToStream(std::ostream &ostr, const T &x, const SprinterLayout &layout)
Convenience: if sequence type (array, list, set, map) not given, assume array.
Definition Sprinter.h:324
std::ostream & operator<<(std::ostream &ostr, const PlainData< DT > &d)
Definition Data.h:631
A container for a static dictionary of enumeration values.
Definition Enum.h:51
Definition Sprinter.h:136