Last change
on this file since 546 was
517,
checked in by dkearney, 18 years ago
|
removed references to core directory
|
File size:
1.3 KB
|
Line | |
---|
1 | #include "RpLibrary.h" |
---|
2 | #include "RpUnits.h" |
---|
3 | #include <string> |
---|
4 | |
---|
5 | #include "EXTERN.h" |
---|
6 | #include "perl.h" |
---|
7 | #include "XSUB.h" |
---|
8 | |
---|
9 | #include "ppport.h" |
---|
10 | |
---|
11 | using namespace std; |
---|
12 | |
---|
13 | MODULE = Rappture PACKAGE = Rappture::RpLibrary |
---|
14 | PROTOTYPES: ENABLE |
---|
15 | |
---|
16 | RpLibrary * |
---|
17 | RpLibrary::new(filename = "") |
---|
18 | char *filename |
---|
19 | CODE: |
---|
20 | RpLibrary *library; |
---|
21 | if ((filename == NULL) || (*filename == '\0')) |
---|
22 | library = new RpLibrary(); |
---|
23 | else |
---|
24 | library = new RpLibrary(filename); |
---|
25 | |
---|
26 | if (library->isNull()) |
---|
27 | { |
---|
28 | delete library; |
---|
29 | XSRETURN_UNDEF; |
---|
30 | } |
---|
31 | else |
---|
32 | RETVAL = library; |
---|
33 | OUTPUT: |
---|
34 | RETVAL |
---|
35 | |
---|
36 | void * |
---|
37 | RpLibrary::DESTROY() |
---|
38 | CODE: |
---|
39 | RETVAL = 0; |
---|
40 | |
---|
41 | const char * |
---|
42 | RpLibrary::get( path ) |
---|
43 | char *path |
---|
44 | CODE: |
---|
45 | string result; |
---|
46 | result = THIS->get(path); |
---|
47 | RETVAL = result.c_str(); |
---|
48 | OUTPUT: |
---|
49 | RETVAL |
---|
50 | |
---|
51 | void |
---|
52 | RpLibrary::put( path, value, append ) |
---|
53 | char *path |
---|
54 | char *value |
---|
55 | int append |
---|
56 | CODE: |
---|
57 | THIS->put(path,value,"",append); |
---|
58 | |
---|
59 | void |
---|
60 | RpLibrary::result() |
---|
61 | |
---|
62 | MODULE = Rappture PACKAGE = Rappture::RpUnits |
---|
63 | |
---|
64 | const char * |
---|
65 | convert( fromVal, toUnitsName, showUnits = 1 ) |
---|
66 | const char *fromVal |
---|
67 | const char *toUnitsName |
---|
68 | int showUnits |
---|
69 | CODE: |
---|
70 | string result; |
---|
71 | result = RpUnits::convert(fromVal,toUnitsName,showUnits); |
---|
72 | |
---|
73 | if (result.empty()) |
---|
74 | XSRETURN_UNDEF; |
---|
75 | |
---|
76 | RETVAL = result.c_str(); |
---|
77 | OUTPUT: |
---|
78 | RETVAL |
---|
Note: See
TracBrowser
for help on using the repository browser.