Generated on for Gecode by doxygen 1.18.0

Reader spec for a textual instance format. More...

#include <gecode/instance.hh>

Public Member Functions

 Spec (void)
 The empty spec (reads only empty input).

Information

std::string name (void) const
 Return the format name declared by the spec (may be empty).

Reading

Data read (const std::string &path, const Params &p=Params()) const
 Read instance file path.
Data read_text (const std::string &text, const std::string &origin="<input>", const Params &p=Params()) const
 Read instance text, using origin in error messages.
Data catalog (const std::string &path, const Params &p=Params()) const
 List the instances in file path.
Data catalog_text (const std::string &text, const std::string &origin="<input>", const Params &p=Params()) const
 List the instances in text, using origin in error messages.

Creating specs

static Spec parse (const std::string &text, const std::string &origin="<spec>")
 Parse spec text, using origin in error messages.
static Spec load (const std::string &path)
 Load the spec in file path.

Detailed Description

Reader spec for a textual instance format.

Definition at line 470 of file instance.hh.

Constructor & Destructor Documentation

◆ Spec()

Gecode::Instance::Spec::Spec ( void )

The empty spec (reads only empty input).

Member Function Documentation

◆ parse()

Spec Gecode::Instance::Spec::parse ( const std::string & text,
const std::string & origin = "<spec>" )
static

Parse spec text, using origin in error messages.

◆ load()

Spec Gecode::Instance::Spec::load ( const std::string & path)
static

Load the spec in file path.

◆ name()

std::string Gecode::Instance::Spec::name ( void ) const

Return the format name declared by the spec (may be empty).

◆ read()

Data Gecode::Instance::Spec::read ( const std::string & path,
const Params & p = Params() ) const

Read instance file path.

The parameters p give values for the spec's param statements.

◆ read_text()

Data Gecode::Instance::Spec::read_text ( const std::string & text,
const std::string & origin = "<input>",
const Params & p = Params() ) const

Read instance text, using origin in error messages.

◆ catalog()

Data Gecode::Instance::Spec::catalog ( const std::string & path,
const Params & p = Params() ) const

List the instances in file path.

The result has the integer instances, the number of instances in the file (1 if the spec has no instances statement), the string array name when every instance defines a name, and the string array failed when an instance fails a check or lacks or repeats a sections line: the first such failure of each instance, or the empty string.

◆ catalog_text()

Data Gecode::Instance::Spec::catalog_text ( const std::string & text,
const std::string & origin = "<input>",
const Params & p = Params() ) const

List the instances in text, using origin in error messages.


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