SNAP Library 2.1, User Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TUniChDb::TSubcatHelper Class Reference

#include <unicode.h>

List of all members.

Public Member Functions

 TSubcatHelper (TUniChDb &owner_)
void ProcessComment (TUniChDb::TUcdFileReader &reader)
void SetCat (const int cp)
void TestCat (const int cp)
 ~TSubcatHelper ()

Public Attributes

bool hasCat
TUniChSubCategory subCat
TStrH invalidCatCodes
TUniChDbowner

Detailed Description

Definition at line 1720 of file unicode.h.


Constructor & Destructor Documentation

Definition at line 1727 of file unicode.h.

: owner(owner_) { }

Definition at line 1754 of file unicode.h.

                {
                        if (invalidCatCodes.IsKey("L&")) invalidCatCodes.DelKey("L&");
                        // Output any unexpected ones (there shouldn't be any).
                        if (! invalidCatCodes.Empty()) {
                                printf("Invalid cat code(s) in the comments: ");
                                for (int i = invalidCatCodes.FFirstKeyId(); invalidCatCodes.FNextKeyId(i); )
                                        printf(" \"%s\"", invalidCatCodes.GetKey(i).CStr());
                                printf("\n"); }
                }

Member Function Documentation

Definition at line 1729 of file unicode.h.

                {
                        hasCat = false; subCat = ucOtherNotAssigned;
                        if (reader.comment.Len() > 3)
                        {
                                IAssert(reader.comment[0] == '#');
                                IAssert(reader.comment[1] == ' ');
                                char chCat = reader.comment[2], chSubCat = reader.comment[3];
                                if (reader.comment.Len() > 4) IAssert(isspace(uchar(reader.comment[4])));
                                if (TUniChInfo::IsValidSubCat(chCat, chSubCat)) {
                                        hasCat = true; subCat = (TUniChSubCategory) ((int(uchar(chCat)) << 8) | (int(uchar(chSubCat)))); }
                                else invalidCatCodes.AddKey(TStr(chCat) + TStr(chSubCat));
                        }
                }
void TUniChDb::TSubcatHelper::SetCat ( const int  cp) [inline]

Definition at line 1744 of file unicode.h.

                                          {
                        int i = owner.h.GetKeyId(cp); IAssert(i >= 0);
                        IAssert(owner.h[i].subCat == ucOtherNotAssigned);
                        IAssert(hasCat);
                        owner.h[i].SetCatAndSubCat(subCat); }
void TUniChDb::TSubcatHelper::TestCat ( const int  cp) [inline]

Definition at line 1749 of file unicode.h.

                                           {
                        if (! hasCat) return;
                        int i = owner.h.GetKeyId(cp); IAssert(i >= 0);
                        IAssert(owner.h[i].subCat == subCat); }

Member Data Documentation

Definition at line 1723 of file unicode.h.

Definition at line 1725 of file unicode.h.


The documentation for this class was generated from the following file: