source: git/gfanlib/gfanlib_polymakefile.h

spielwiese
Last change on this file was c4d065, checked in by Frank Seelisch <seelisch@…>, 13 years ago
coding at Goettingen (cones&fans) git-svn-id: file:///usr/local/Singular/svn/trunk@13677 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * gfanlib_polymakefile.h
3 *
4 *  Created on: Nov 17, 2010
5 *      Author: anders
6 */
7
8#ifndef GFANLIB_POLYMAKEFILE_H_INCLUDED
9#define GFANLIB_POLYMAKEFILE_H_INCLUDED
10
11
12#include <list>
13#include <vector>
14#include <string>
15#include <iostream>
16
17#include "gfanlib_matrix.h"
18
19namespace gfan
20{
21class PolymakeProperty
22{
23 public:
24  std::string value;
25  std::string name;
26  PolymakeProperty(const std::string &name_, const std::string &value_);
27};
28
29class PolymakeFile
30{
31  std::string application,type;
32  std::string fileName;
33  std::list<PolymakeProperty> properties;
34  std::list<PolymakeProperty>::iterator findProperty(const char *p);
35  void writeProperty(const char *p, const std::string &data);
36  bool isXml;
37 public:
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);
42  void close();
43  bool hasProperty(const char *p, bool doAssert=false);
44
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);
48
49  bool readBooleanProperty(const char *p);
50  void writeBooleanProperty(const char *p, bool n);
51
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);
54
55  std::vector<std::list<int> > readMatrixIncidenceProperty(const char *p);
56  void writeIncidenceMatrixProperty(const char *p, const std::vector<std::list<int> > &m);
57
58  ZVector readCardinalVectorProperty(const char *p);
59  void writeCardinalVectorProperty(const char *p, ZVector const &v);
60
61  void writeStringProperty(const char *p, const std::string &s);
62};
63}
64
65#endif
66
Note: See TracBrowser for help on using the repository browser.