00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <openrj/stl/database.hpp>
00026
00027
00028 #include <iostream>
00029
00030
00031
00032
00033
00034 using std::cerr;
00035 using std::endl;
00036 using std::cout;
00037
00038
00039
00040
00041
00042
00043 static const char contents[] =
00044
00045 "%% Sample Open-RJ database - Cats and Dogs\n"
00046 "%% Created: 28th September 2004\n"
00047 "%% Updated: 29th September 2004\n"
00048 "Name: Barney\n"
00049 "Species: Dog\n"
00050 "Breed: Bijon \\\n"
00051 " Frieze\n"
00052 "%%\n"
00053 "Name: Elsa\n"
00054 "Species: Dog\n"
00055 "Breed: Mixed\n"
00056 "%%\n"
00057 "Name: Fluffy Kitten\n"
00058 "Species: Cat\n"
00059 "%%\n"
00060 "Name: Moet\n"
00061 "Species: Dog\n"
00062 "Breed: Boxer\n"
00063 "%%\n"
00064 "Name: Rebel\n"
00065 "Species: Dog\n"
00066 "Breed: German \\\n"
00067 " Shepherd"
00068 "%%\n"
00069 "Name: Sparky\n"
00070 "Species: Cat\n"
00071 "%%\n";
00072
00073
00074
00075 int main()
00076 {
00077 try
00078 {
00079 unsigned flags = 0;
00080 openrj::stl::memory_database db(&contents[0], sizeof(contents), flags);
00081
00082 }
00083 catch(std::exception &x)
00084 {
00085 cerr << "Failed to open database: " << x.what() << endl;
00086 }
00087
00088 return EXIT_SUCCESS;
00089 }
00090
00091
00092
00093