Tesseract  3.02
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)
bool DeSerialize (bool swap, FILE *fp)

Static Public Member Functions

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

Public Attributes

GenericVector< int > font_ids
int 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 40 of file shapetable.cpp.

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

Definition at line 32 of file shapetable.cpp.

                                        {
  inT32 uni_id = unichar_id;
  if (fwrite(&uni_id, sizeof(uni_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 51 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

Definition at line 53 of file shapetable.h.


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