model_test.cpp File Reference

#include <stdio.h>
#include "text_model.h"
Include dependency graph for model_test.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 33 of file model_test.cpp.

References text::TextModel::get_paragraph(), text::TextModel::get_paragraph_count(), and text::TextModel::open().

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 }

Here is the call graph for this function:

Generated by  doxygen 1.6.2-20100208