~ubuntu-branches/ubuntu/oneiric/strigi/oneiric

« back to all changes in this revision

Viewing changes to src/xsd/strigidaemonconfigurationtest.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2011-09-24 17:12:15 UTC
  • mfrom: (1.2.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: package-import@ubuntu.com-20110924171215-zmbi1f77jntvz65h
Tags: upstream-0.7.6
ImportĀ upstreamĀ versionĀ 0.7.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* This file is generated from strigidaemonconfiguration.xsd */
2
 
#include <iostream>
3
 
#include <fstream>
4
 
#include <sstream>
5
 
#include "strigidaemonconfiguration.h"
6
 
std::string
7
 
read(const std::string& file) {
8
 
        std::stringbuf buf;
9
 
        std::ifstream f(file.c_str(), std::ios::binary);
10
 
        f.get(buf, '\0');
11
 
        f.close();
12
 
        return buf.str();
13
 
}
14
 
int
15
 
main() {
16
 
        std::string xml;
17
 
        int n = 1;
18
 
        std::ofstream f;
19
 
 
20
 
        std::ostringstream filename;
21
 
 
22
 
        filename << n++ << ".xml";
23
 
        xml = read(filename.str());
24
 
        Path path(xml);
25
 
        f.open(filename.str().c_str(), std::ios::binary);
26
 
        f << path;
27
 
        f.close();
28
 
        filename.str("");
29
 
 
30
 
        filename << n++ << ".xml";
31
 
        xml = read(filename.str());
32
 
        Repository repository(xml);
33
 
        f.open(filename.str().c_str(), std::ios::binary);
34
 
        f << repository;
35
 
        f.close();
36
 
        filename.str("");
37
 
 
38
 
        filename << n++ << ".xml";
39
 
        xml = read(filename.str());
40
 
        Filter filter(xml);
41
 
        f.open(filename.str().c_str(), std::ios::binary);
42
 
        f << filter;
43
 
        f.close();
44
 
        filename.str("");
45
 
 
46
 
        filename << n++ << ".xml";
47
 
        xml = read(filename.str());
48
 
        Filters filters(xml);
49
 
        f.open(filename.str().c_str(), std::ios::binary);
50
 
        f << filters;
51
 
        f.close();
52
 
        filename.str("");
53
 
 
54
 
        filename << n++ << ".xml";
55
 
        xml = read(filename.str());
56
 
        StrigiDaemonConfiguration strigidaemonconfiguration(xml);
57
 
        f.open(filename.str().c_str(), std::ios::binary);
58
 
        f << strigidaemonconfiguration;
59
 
        f.close();
60
 
        filename.str("");
61
 
 
62
 
 
63
 
        return 0;
64
 
}