Vcsn  2.2a
Be Rational
vcsn::format Class Reference

An input/output format for valuesets. More...

#include <format.hh>

Collaboration diagram for vcsn::format:

Public Types

enum  format_t {
  latex, raw, sname, text,
  utf8, deflt = text
}
 Type of format. More...
 
using self_t = format
 

Public Member Functions

 format (format_t f=deflt)
 
 format (const std::string &f)
 
format for_labels () const
 A copy of this format, but to print labels. More...
 
format for_weights () const
 A copy of this format, but to print weights. More...
 
bool delimit () const
 Whether we should delimit: (1, 2) instead of 1, 2. More...
 
format delimit (bool d) const
 Set whether we should delimit: (1, 2) instead of 1, 2. More...
 
bool is_for_labels () const
 Whether to use the syntax for labels (e.g., "a|x"). More...
 
bool is_for_weights () const
 Whether to use the syntax for weights (e.g., "(1, 1/2)"). More...
 
format_t kind () const
 
bool operator< (self_t that) const
 
bool operator== (self_t that) const
 
bool operator!= (self_t that) const
 

Private Attributes

format_t format_
 
bool label_ = false
 Whether printed as a label (e.g., a|x), or as a weight (e.g., (1, 1/2)). More...
 
bool delimit_ = false
 Whether we should delimit. E.g., 1, 2 or (1, 2). More...
 

Detailed Description

An input/output format for valuesets.

For instance, whether text or latex, and other syntactic issues.

Definition at line 11 of file format.hh.

Member Typedef Documentation

Definition at line 14 of file format.hh.

Member Enumeration Documentation

Type of format.

Enumerator
latex 

Print for LaTeX.

raw 

Print as is. For instance, don't try to escape labels.

sname 

Print as a parsable type string.

text 

Print as plain (ASCII) text, escaped.

utf8 

Print as rich UTF-8 text, escaped.

deflt 

By default, print for text.

Definition at line 17 of file format.hh.

Constructor & Destructor Documentation

vcsn::format::format ( format_t  f = deflt)
inline

Definition at line 33 of file format.hh.

vcsn::format::format ( const std::string &  f)

Definition at line 13 of file format.cc.

References deflt, format_, latex, vcsn::map, raw, sname, text, and utf8.

Member Function Documentation

bool vcsn::format::delimit ( ) const
inline

Whether we should delimit: (1, 2) instead of 1, 2.

Definition at line 56 of file format.hh.

References delimit_.

format vcsn::format::delimit ( bool  d) const
inline

Set whether we should delimit: (1, 2) instead of 1, 2.

Definition at line 62 of file format.hh.

References delimit_.

format vcsn::format::for_labels ( ) const
inline

A copy of this format, but to print labels.

Definition at line 40 of file format.hh.

References label_.

Referenced by vcsn::rat::dot_printer< ExpSet >::print_(), and vcsn::detail::polynomialset_impl< Context, Kind >::print_with_classes_().

format vcsn::format::for_weights ( ) const
inline

A copy of this format, but to print weights.

Definition at line 48 of file format.hh.

References label_.

Referenced by vcsn::rat::printer< ExpSet >::print_(), and vcsn::rat::dot_printer< ExpSet >::print_().

bool vcsn::format::is_for_labels ( ) const
inline

Whether to use the syntax for labels (e.g., "a|x").

Definition at line 70 of file format.hh.

References label_.

bool vcsn::format::is_for_weights ( ) const
inline

Whether to use the syntax for weights (e.g., "(1, 1/2)").

Definition at line 76 of file format.hh.

References label_.

format_t vcsn::format::kind ( ) const
inline

Definition at line 81 of file format.hh.

References format_.

Referenced by vcsn::detail::tupleset_impl< ValueSets >::print_set_(), and vcsn::to_string().

bool vcsn::format::operator!= ( self_t  that) const
inline

Definition at line 96 of file format.hh.

References operator==().

Here is the call graph for this function:

bool vcsn::format::operator< ( self_t  that) const
inline

Definition at line 86 of file format.hh.

References format_.

bool vcsn::format::operator== ( self_t  that) const
inline

Definition at line 91 of file format.hh.

References format_.

Referenced by operator!=().

Member Data Documentation

bool vcsn::format::delimit_ = false
private

Whether we should delimit. E.g., 1, 2 or (1, 2).

Definition at line 107 of file format.hh.

Referenced by delimit().

format_t vcsn::format::format_
private

Definition at line 102 of file format.hh.

Referenced by format(), kind(), operator<(), and operator==().

bool vcsn::format::label_ = false
private

Whether printed as a label (e.g., a|x), or as a weight (e.g., (1, 1/2)).

Definition at line 105 of file format.hh.

Referenced by for_labels(), for_weights(), is_for_labels(), and is_for_weights().


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