pdf_anchor.h
Go to the documentation of this file.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 
00026 
00027 #ifndef PDF_ANCHOR_H_
00028 #define PDF_ANCHOR_H_
00029 
00030 #include "pdf_define.h"
00031 
00032 namespace pdf
00033 {
00034 
00035 class PDFAnchor
00036 {
00037 public:
00038     int     page_num;      
00039     int     word_num;      
00040     int     char_idx;      
00041     int     link_idx;      
00042     int     toc_idx;       
00043     string  file_name;     
00044 
00045 public:
00046     PDFAnchor();
00047     PDFAnchor(const string &anchor);
00048     ~PDFAnchor();
00049 
00050     bool operator == (const PDFAnchor &right) const;
00051 
00052 
00053     bool is_end_anchor() const;
00054 
00055 
00056     void set_end_anchor();
00057 
00058 
00059     const string& get_string();
00060 
00061 
00062 
00063 
00064 
00065     static int compare(const PDFAnchor &a1, const PDFAnchor &a2);
00066 
00067     void validate_for_getting_text(void);
00068 
00069 private:
00070     string    anchor_str;
00071 
00072 private:
00073     bool operator < (const PDFAnchor &right) const;
00074     bool operator > (const PDFAnchor &right) const;
00075 
00076 
00077     bool parse(const string &anchor);
00078 
00079 
00080     bool pack(string &anchor);
00081 
00082 
00083     void reset();
00084 
00085 
00086     int get_num(const string &page_sub_str);
00087 
00088 
00089     const string get_prefix(const string &str);
00090 
00091 
00092     const string get_postfix(const string &str);
00093 
00094 };
00095 
00096 };
00097 
00098 #endif //PDF_ANCHOR_H_
00099