source: git/gfanlib/gfanlib_polymakefile.h @ c512d9

spielwiese
Last change on this file since c512d9 was 74a91c9, checked in by Frank Seelisch <seelisch@…>, 13 years ago
new gfan lib version by Anders Jensen git-svn-id: file:///usr/local/Singular/svn/trunk@13668 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 create(const char *fileName_, const char *application_, const char *type_, bool isXml_=false);
40  void writeStream(std::ostream &file);
41  void close();
42  bool hasProperty(const char *p, bool doAssert=false);
43
44  // The following could be part of a subclass to avoid dependencies on gfan
45  Integer readCardinalProperty(const char *p);
46  void writeCardinalProperty(const char *p, Integer n);
47
48  bool readBooleanProperty(const char *p);
49  void writeBooleanProperty(const char *p, bool n);
50
51  ZMatrix readMatrixProperty(const char *p, int height, int width);
52  void writeMatrixProperty(const char *p, const ZMatrix &m, bool indexed=false, const std::vector<std::string> *comments=0);
53
54  std::vector<std::list<int> > readMatrixIncidenceProperty(const char *p);
55  void writeIncidenceMatrixProperty(const char *p, const std::vector<std::list<int> > &m);
56
57  ZVector readCardinalVectorProperty(const char *p);
58  void writeCardinalVectorProperty(const char *p, ZVector const &v);
59
60  void writeStringProperty(const char *p, const std::string &s);
61};
62}
63
64#endif
65
Note: See TracBrowser for help on using the repository browser.