Revision 365, 0.8 kB
(checked in by wagi, 17 years ago)
|
src/libfreebobavc/serialize* moved to src/libfreebob/avc_serialize*, all includes adapted
src/bebob/bebob_serialize* moved to src/libutil/serialize*
src/libutil/serialize: use Glib::ustring instead of std::string.
src/configrom: serialize and deserialize added (not finished)
src/devicemanager: load and save cached functionality added (not finished)
various small whitespace updates (emacs lässt grüssen :))
|
Line | |
---|
1 |
#include "devicemanager.h" |
---|
2 |
#include "bebob/bebob_avdevice.h" |
---|
3 |
#include "libutil/serialize.h" |
---|
4 |
|
---|
5 |
#include <iostream> |
---|
6 |
|
---|
7 |
const char FileName[] = "bebob.xml"; |
---|
8 |
|
---|
9 |
static bool |
---|
10 |
serialize( const char* pFileName ) |
---|
11 |
{ |
---|
12 |
DeviceManager devMgr; |
---|
13 |
devMgr.initialize( 0 ); |
---|
14 |
devMgr.discover( 0 ); |
---|
15 |
return devMgr.saveCache( pFileName ); |
---|
16 |
} |
---|
17 |
|
---|
18 |
static bool |
---|
19 |
deserialize( const char* pFileName ) |
---|
20 |
{ |
---|
21 |
DeviceManager devMgr; |
---|
22 |
devMgr.initialize( 0 ); |
---|
23 |
return devMgr.loadCache( pFileName ); |
---|
24 |
} |
---|
25 |
|
---|
26 |
int |
---|
27 |
main( int argc, char** argv ) |
---|
28 |
{ |
---|
29 |
if ( !serialize( FileName ) ) { |
---|
30 |
std::cerr << "serializing failed" << std::endl; |
---|
31 |
return -1; |
---|
32 |
} |
---|
33 |
if ( !deserialize( FileName ) ) { |
---|
34 |
std::cerr << "deserializing failed" << std::endl; |
---|
35 |
return -1; |
---|
36 |
} |
---|
37 |
|
---|
38 |
std::cout << "passed" << std::endl; |
---|
39 |
return 0; |
---|
40 |
} |
---|