Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tesseract::UnicharAndFonts Struct Reference

#include <shapetable.h>

List of all members.

Public Member Functions

 UnicharAndFonts ()
 UnicharAndFonts (int uni_id, int font_id)
bool Serialize (FILE *fp) const
bool DeSerialize (bool swap, FILE *fp)

Static Public Member Functions

static int SortByUnicharId (const void *v1, const void *v2)

Public Attributes

GenericVector< inT32font_ids
inT32 unichar_id

Detailed Description

Definition at line 36 of file shapetable.h.


Constructor & Destructor Documentation

tesseract::UnicharAndFonts::UnicharAndFonts ( )
inline

Definition at line 37 of file shapetable.h.

: unichar_id(0) {
}
tesseract::UnicharAndFonts::UnicharAndFonts ( int  uni_id,
int  font_id 
)
inline

Definition at line 39 of file shapetable.h.

: unichar_id(uni_id) {
font_ids.push_back(font_id);
}

Member Function Documentation

bool tesseract::UnicharAndFonts::DeSerialize ( bool  swap,
FILE *  fp 
)

Definition at line 39 of file shapetable.cpp.

{
if (fread(&unichar_id, sizeof(unichar_id), 1, fp) != 1) return false;
if (swap)
if (!font_ids.DeSerialize(swap, fp)) return false;
return true;
}
bool tesseract::UnicharAndFonts::Serialize ( FILE *  fp) const

Definition at line 32 of file shapetable.cpp.

{
if (fwrite(&unichar_id, sizeof(unichar_id), 1, fp) != 1) return false;
if (!font_ids.Serialize(fp)) return false;
return true;
}
int tesseract::UnicharAndFonts::SortByUnicharId ( const void *  v1,
const void *  v2 
)
static

Definition at line 48 of file shapetable.cpp.

{
const UnicharAndFonts* p1 = reinterpret_cast<const UnicharAndFonts*>(v1);
const UnicharAndFonts* p2 = reinterpret_cast<const UnicharAndFonts*>(v2);
return p1->unichar_id - p2->unichar_id;
}

Member Data Documentation

GenericVector<inT32> tesseract::UnicharAndFonts::font_ids

Definition at line 52 of file shapetable.h.

inT32 tesseract::UnicharAndFonts::unichar_id

Definition at line 53 of file shapetable.h.


The documentation for this struct was generated from the following files: