-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPropertyNodeValue.h
77 lines (51 loc) · 2.45 KB
/
PropertyNodeValue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***********************************************************************
* Created by Andreas Paffenholz on 18/01/14.
* Copyright 2012-2014 by Andreas Paffenholz.
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version: http://www.gnu.org/licenses/gpl.txt.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* PolymakeNodeValue.h
* PolyViewer
**************************************************************************/
#import <Foundation/Foundation.h>
// templateParameters holds an array of DataTypeStructs, one for each template parameter, or is nil
// the template params may themselves be templated, if not, their property templateParameters points to nil
// FIXME this is not really a clever way to store the type... retrieval of information is too complicated
struct DataTypeStruct {
NSString * name;
NSArray * templateParameters;
};
/*
The actual value of a property
only properties at the leaves of the porperty tree contain information
all others are just set to "no value"
FIXME: column alignment does not work currently
*/
@interface PropertyNodeValue : NSObject {
// the actual data as string
NSString * _data;
// currently we keep the type of data both as a string and a DataTypeStruct
// FIXME one should go
NSString * _dataType;
struct DataTypeStruct _dataTypeStructure;
BOOL _isEmpty; // true if _data is empty
} //interface end
// init
- (id) initWithValue:(NSString *)value
ofType:(NSString *)type;
// each time the data is requested we recompute an aligned version
// FIXME for efficiency we could either store the aligned version
// or store a more structured version of the data that supports both aligned and non/aligned display
- (NSString *) dataWithAlignedColumns:(BOOL)alignedCols;
// synthesized class variables
@property (readwrite,retain) NSString * data;
@property (readwrite,retain) NSString * dataType;
@property (readwrite,assign) BOOL isEmpty;
@property (readonly,retain) NSMutableArray * columnWidths;
@end