~ubuntu-branches/ubuntu/saucy/gfan/saucy-proposed

« back to all changes in this revision

Viewing changes to gfanlib_polymakefile.h

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2013-07-09 10:44:01 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130709104401-5q66ozz5j5af0dak
Tags: 0.5+dfsg-3
* Upload to unstable.
* modify remove_failing_tests_on_32bits.patch to replace command of
  0009RenderStairCase test with an empty one instead of deleting it.
* remove lintian override about spelling error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
19
namespace gfan
 
20
{
 
21
class PolymakeProperty
 
22
{
 
23
 public:
 
24
  std::string value;
 
25
  std::string name;
 
26
  PolymakeProperty(const std::string &name_, const std::string &value_);
 
27
};
 
28
 
 
29
class 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