Rev | Line | |
---|
[665] | 1 | #include "rappture.h" |
---|
[481] | 2 | #include <string> |
---|
| 3 | |
---|
| 4 | #include "EXTERN.h" |
---|
| 5 | #include "perl.h" |
---|
| 6 | #include "XSUB.h" |
---|
| 7 | |
---|
| 8 | #include "ppport.h" |
---|
| 9 | |
---|
| 10 | using namespace std; |
---|
| 11 | |
---|
[1089] | 12 | MODULE = Rappture PACKAGE = Rappture::RpLibrary |
---|
[481] | 13 | PROTOTYPES: ENABLE |
---|
| 14 | |
---|
| 15 | RpLibrary * |
---|
| 16 | RpLibrary::new(filename = "") |
---|
[1095] | 17 | const char *filename |
---|
[1089] | 18 | CODE: |
---|
[481] | 19 | RpLibrary *library; |
---|
[1089] | 20 | if ((filename == NULL) || (*filename == '\0')) |
---|
| 21 | library = new RpLibrary(); |
---|
| 22 | else |
---|
| 23 | library = new RpLibrary(filename); |
---|
[481] | 24 | |
---|
[1089] | 25 | if (library->isNull()) |
---|
[481] | 26 | { |
---|
| 27 | delete library; |
---|
[1089] | 28 | XSRETURN_UNDEF; |
---|
[481] | 29 | } |
---|
[1089] | 30 | else |
---|
| 31 | RETVAL = library; |
---|
| 32 | OUTPUT: |
---|
| 33 | RETVAL |
---|
[481] | 34 | |
---|
| 35 | void * |
---|
| 36 | RpLibrary::DESTROY() |
---|
[1089] | 37 | CODE: |
---|
| 38 | RETVAL = 0; |
---|
[2549] | 39 | OUTPUT: |
---|
| 40 | RETVAL |
---|
[481] | 41 | |
---|
[1716] | 42 | SV * |
---|
[481] | 43 | RpLibrary::get( path ) |
---|
[1095] | 44 | const char *path |
---|
[1089] | 45 | CODE: |
---|
| 46 | string result; |
---|
| 47 | result = THIS->get(path); |
---|
[1716] | 48 | RETVAL = newSVpvn(result.data(),result.length()); |
---|
[1089] | 49 | OUTPUT: |
---|
| 50 | RETVAL |
---|
[481] | 51 | |
---|
| 52 | void |
---|
| 53 | RpLibrary::put( path, value, append ) |
---|
[1095] | 54 | const char *path |
---|
| 55 | const char *value |
---|
[481] | 56 | int append |
---|
[1089] | 57 | CODE: |
---|
| 58 | THIS->put(path,value,"",append); |
---|
[591] | 59 | |
---|
[481] | 60 | void |
---|
[605] | 61 | RpLibrary::putFile( path, fileName, compress, append ) |
---|
[1095] | 62 | const char *path |
---|
| 63 | const char *fileName |
---|
[605] | 64 | int compress |
---|
[591] | 65 | int append |
---|
[1089] | 66 | CODE: |
---|
| 67 | THIS->putFile(path,fileName,compress,append); |
---|
[591] | 68 | |
---|
| 69 | void |
---|
[481] | 70 | RpLibrary::result() |
---|
[1089] | 71 | CODE: |
---|
| 72 | THIS->put("tool.version.rappture.language", "perl"); |
---|
| 73 | THIS->result(); |
---|
[481] | 74 | |
---|
[1089] | 75 | MODULE = Rappture PACKAGE = Rappture::RpUnits |
---|
[481] | 76 | |
---|
| 77 | const char * |
---|
| 78 | convert( fromVal, toUnitsName, showUnits = 1 ) |
---|
| 79 | const char *fromVal |
---|
| 80 | const char *toUnitsName |
---|
| 81 | int showUnits |
---|
[1089] | 82 | CODE: |
---|
| 83 | string result; |
---|
| 84 | result = RpUnits::convert(fromVal,toUnitsName,showUnits); |
---|
[481] | 85 | |
---|
| 86 | if (result.empty()) |
---|
| 87 | XSRETURN_UNDEF; |
---|
| 88 | |
---|
[1089] | 89 | RETVAL = result.c_str(); |
---|
| 90 | OUTPUT: |
---|
| 91 | RETVAL |
---|
[665] | 92 | |
---|
[1089] | 93 | MODULE = Rappture PACKAGE = Rappture::Utils |
---|
[665] | 94 | |
---|
| 95 | int |
---|
| 96 | progress( percent, message ) |
---|
| 97 | int percent |
---|
| 98 | const char *message |
---|
[1089] | 99 | CODE: |
---|
| 100 | RETVAL = Rappture::Utils::progress(percent,message); |
---|
| 101 | OUTPUT: |
---|
| 102 | RETVAL |
---|
Note: See
TracBrowser
for help on using the repository browser.