model_test.cpp

Go to the documentation of this file.
00001 /*
00002  * File Name: model_test.cpp
00003  */
00004 
00005 /*
00006  * This file is part of uds-plugin-plaintext.
00007  *
00008  * uds-plugin-plaintext is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * uds-plugin-plaintext is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00022 /**
00023  * Copyright (C) 2008 iRex Technologies B.V.
00024  * All rights reserved.
00025  */
00026 
00027 #include <stdio.h>
00028 
00029 #include "text_model.h"
00030 
00031 using namespace text;
00032 
00033 int main(int argc, char* argv[])
00034 {
00035     if (argc != 2)
00036     {
00037         fprintf(stderr, "Usage: %s <file_path>.\n", argv[0]);
00038         return -1;
00039     }
00040 
00041     std::string doc_path(argv[1]);
00042     TextModel doc(doc_path);
00043 
00044     assert(doc.open());
00045     doc.read_text();
00046 
00047     const std::string *paragraph = 0;
00048     for (unsigned int i=0; i<doc.get_paragraph_count(); i++)
00049     {
00050         paragraph = doc.get_paragraph(i);
00051         printf("%s", paragraph->c_str());
00052     }
00053 
00054     getchar();
00055     return 0;
00056 }
00057 
Generated by  doxygen 1.6.2-20100208