SVG for C++
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SVG::ClassList Class Reference

Ordered token list for managing the class attribute. More...

#include <svg.hpp>

Public Member Functions

 ClassList (std::string &value)
 
 ClassList (const std::string &value)
 
bool contains (const std::string &token) const
 
ClassListadd (const std::string &token)
 
ClassListremove (const std::string &token)
 
bool toggle (const std::string &token)
 
ClassListset (const std::string &class_names)
 
ClassListclear ()
 
std::string str () const
 
std::vector< std::string > tokens () const
 

Detailed Description

Ordered token list for managing the class attribute.

Member Function Documentation

◆ add()

ClassList & SVG::ClassList::add ( const std::string &  token)
inline

Add a class token if it does not already exist

◆ clear()

ClassList & SVG::ClassList::clear ( )
inline

Remove all classes

◆ contains()

bool SVG::ClassList::contains ( const std::string &  token) const
inline

Return true when the class token exists

◆ remove()

ClassList & SVG::ClassList::remove ( const std::string &  token)
inline

Remove a class token if it exists

◆ set()

ClassList & SVG::ClassList::set ( const std::string &  class_names)
inline

Replace the class attribute with a whitespace-normalized token list

◆ str()

std::string SVG::ClassList::str ( ) const
inline

Return normalized class text

◆ toggle()

bool SVG::ClassList::toggle ( const std::string &  token)
inline

Add a missing token or remove an existing token, returning true when present

◆ tokens()

std::vector< std::string > SVG::ClassList::tokens ( ) const
inline

Return the current tokens in order


The documentation for this class was generated from the following file: