1
// =============================================================== //
3
// File : ps_my2ascii.cxx //
6
// Coded by Wolfram Foerster in October 2002 //
7
// Institute of Microbiology (Technical University Munich) //
8
// http://www.arb-home.de/ //
10
// =============================================================== //
5
#ifndef PS_FILE_BUFFER_HXX
6
#include "ps_filebuffer.hxx"
9
12
#include "ps_node.hxx"
12
// ====================================================
13
// ====================================================
15
int main( int argc, char *argv[] ) {
14
// ====================================================
15
// ====================================================
17
int main(int argc, char *argv[]) {
21
printf("Missing arguments\n Usage %s <input database name> <output database name>\n",argv[0]);
23
printf("Missing arguments\n Usage %s <input database name> <output database name>\n", argv[0]);
28
30
PS_Node *root = new PS_Node(-1);
29
31
const char *input_DB_name = argv[1];
30
PS_FileBuffer *ps_db_fb = new PS_FileBuffer( input_DB_name, PS_FileBuffer::READONLY );
32
PS_FileBuffer *ps_db_fb = new PS_FileBuffer(input_DB_name, PS_FileBuffer::READONLY);
32
printf( "Opening input-probe-set-database '%s'..\n", input_DB_name );
33
root->load( ps_db_fb );
34
printf( "loaded database (enter to continue)\n" );
34
printf("Opening input-probe-set-database '%s'..\n", input_DB_name);
36
printf("loaded database (enter to continue)\n");
40
41
const char *output_DB_name = argv[2];
41
printf( "writing probe-data to %s\n",output_DB_name );
42
ps_db_fb->reinit( output_DB_name, PS_FileBuffer::WRITEONLY );
43
char *buffer = (char *)malloc( 512 );
44
root->saveASCII( ps_db_fb,buffer );
45
printf( "(enter to continue)\n" );
42
printf("writing probe-data to %s\n", output_DB_name);
43
ps_db_fb->reinit(output_DB_name, PS_FileBuffer::WRITEONLY);
44
char *buffer = (char *)malloc(512);
45
root->saveASCII(ps_db_fb, buffer);
46
printf("(enter to continue)\n");
53
printf( "(enter to continue)\n" );
53
printf("(enter to continue)\n");