2
* gfanlib_polymakefile.h
4
* Created on: Nov 17, 2010
8
#ifndef GFANLIB_POLYMAKEFILE_H_INCLUDED
9
#define GFANLIB_POLYMAKEFILE_H_INCLUDED
17
#include "gfanlib_matrix.h"
21
class PolymakeProperty
26
PolymakeProperty(const std::string &name_, const std::string &value_);
31
std::string application,type;
33
std::list<PolymakeProperty> properties;
34
std::list<PolymakeProperty>::iterator findProperty(const char *p);
35
void writeProperty(const char *p, const std::string &data);
38
// void open(const char *fileName_);
39
void open(std::istream &f);
40
void create(const char *fileName_, const char *application_, const char *type_, bool isXml_=false);
41
void writeStream(std::ostream &file);
43
bool hasProperty(const char *p, bool doAssert=false);
45
// The following could be part of a subclass to avoid dependencies on gfan
46
Integer readCardinalProperty(const char *p);
47
void writeCardinalProperty(const char *p, Integer n);
49
bool readBooleanProperty(const char *p);
50
void writeBooleanProperty(const char *p, bool n);
52
ZMatrix readMatrixProperty(const char *p, int height, int width);
53
void writeMatrixProperty(const char *p, const ZMatrix &m, bool indexed=false, const std::vector<std::string> *comments=0);
55
std::vector<std::list<int> > readMatrixIncidenceProperty(const char *p);
56
void writeIncidenceMatrixProperty(const char *p, const std::vector<std::list<int> > &m);
58
ZVector readCardinalVectorProperty(const char *p);
59
void writeCardinalVectorProperty(const char *p, ZVector const &v);
61
void writeStringProperty(const char *p, const std::string &s);