source: trunk/examples/c-example/compress.cc @ 1926

Last change on this file since 1926 was 872, checked in by dkearney, 17 years ago

mainly code cleanups that i've made and stored in my repository over time.

File size: 1.3 KB
Line 
1// ======================================================================
2//  Copyright (c) 2004-2007  Purdue Research Foundation
3//  See the file "license.terms" for information on usage and
4//  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
5// ======================================================================
6
7#include "rappture.h"
8
9#include <stdlib.h>
10#include <iostream>
11
12int main(int argc, char * argv[])
13{
14
15    RpLibrary* lib = NULL;
16
17    std::string xmlFilePath = "";
18    std::string dxFilePath = "";
19
20    if (argc < 3) {
21        std::cout << "usage: " << argv[0] << " driver.xml picture.dx" << std::endl;
22    }
23
24    xmlFilePath = std::string(argv[1]);
25    dxFilePath = std::string(argv[2]);
26
27    // create a rappture library from the file filePath
28    lib = new RpLibrary(xmlFilePath);
29
30    if (lib == NULL) {
31        // cannot open file or out of memory
32        std::cout << "FAILED creating Rappture Library" << std::endl;
33        exit(1);
34    }
35
36    // label the graph with a title
37    lib->put("output.field(dxFile1).about.label",
38        "Example loading of a DX file","",RPLIB_OVERWRITE);
39    lib->putFile("output.field(dxFile1).component.dx",
40        dxFilePath,RPLIB_COMPRESS,RPLIB_OVERWRITE);
41
42
43    // write output to run file and signal
44    lib->result();
45    delete lib;
46
47    return 0;
48}
Note: See TracBrowser for help on using the repository browser.