w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

strsrch.cpp File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unicode/utypes.h>
#include <unicode/ucol.h>
#include <unicode/usearch.h>
#include <unicode/ustring.h>
Include dependency graph for strsrch.cpp:

Go to the source code of this file.

Classes

struct  OptSpec
 

Functions

UBool processOptions (int argc, const char **argv, OptSpec opts[])
 
UBool processCollator ()
 
UBool processStringSearch ()
 
UBool findPattern ()
 
int main (int argc, const char **argv)
 

Variables

const char gHelpString []
 
char * opt_locale = "en_US"
 
char * opt_rules = 0
 
UBool opt_help = 0
 
UBool opt_norm = 0
 
UBool opt_french = 0
 
UBool opt_shifted = 0
 
UBool opt_lower = 0
 
UBool opt_upper = 0
 
UBool opt_case = 0
 
UBool opt_overlap = 0
 
UBool opt_canonical = 0
 
int opt_level = 0
 
char * opt_source = "International Components for Unicode"
 
char * opt_pattern = "Unicode"
 
UCollatorcollator = 0
 
UStringSearchsearch = 0
 
UChar rules [100]
 
UChar source [100]
 
UChar pattern [100]
 
OptSpec opts []
 

Function Documentation

◆ findPattern()

UBool findPattern ( )

◆ main()

int main ( int  argc,
const char **  argv 
)

Main – process command line, read in and pre-process the test file, call other functions to do the actual tests.

Definition at line 282 of file strsrch.cpp.

References argc, argv, collator, findPattern(), fprintf, gHelpString, opt_help, opt_pattern, opt_source, opts, printf(), processCollator(), processOptions(), processStringSearch(), fc-lang::stdout, ucol_close, and usearch_close.

◆ processCollator()

◆ processOptions()

UBool processOptions ( int  argc,
const char **  argv,
OptSpec  opts[] 
)

processOptions() Function to read the command line options.

Definition at line 101 of file strsrch.cpp.

References argc, argv, OptSpec::FLAG, fprintf, i, OptSpec::name, OptSpec::NUM, opts, OptSpec::pVar, strcmp(), OptSpec::STRING, strtol(), and OptSpec::type.

Referenced by main().

◆ processStringSearch()

Variable Documentation

◆ collator

UCollator* collator = 0

Definition at line 64 of file strsrch.cpp.

Referenced by main(), processCollator(), and processStringSearch().

◆ gHelpString

const char gHelpString[]
Initial value:
=
"usage: strsrch [options*] -source source_string -pattern pattern_string\n"
"-help Display this message.\n"
"-locale name ICU locale to use. Default is en_US\n"
"-rules rule Collation rules file (overrides locale)\n"
"-french French accent ordering\n"
"-norm Normalizing mode on\n"
"-shifted Shifted mode\n"
"-lower Lower case first\n"
"-upper Upper case first\n"
"-case Enable separate case level\n"
"-level n Sort level, 1 to 5, for Primary, Secndary, Tertiary, Quaternary, Identical\n"
"-source string Source string\n"
"-pattern string Pattern string to look for in source\n"
"-overlap Enable searching to be done on overlapping patterns\n"
"-canonical Enable searching to be done matching canonical equivalent patterns"
"Example strsrch -rules \\u0026b\\u003ca -source a\\u0020b\\u0020bc -pattern b\n"
"The format \\uXXXX is supported for the rules and comparison strings\n"

© 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html

COPYRIGHT: Copyright (C) 2002-2006 IBM, Inc. All Rights Reserved. This program demos string collation

Definition at line 16 of file strsrch.cpp.

Referenced by main().

◆ opt_canonical

UBool opt_canonical = 0

Definition at line 60 of file strsrch.cpp.

Referenced by processStringSearch().

◆ opt_case

UBool opt_case = 0

Definition at line 58 of file strsrch.cpp.

Referenced by processCollator().

◆ opt_french

UBool opt_french = 0

Definition at line 54 of file strsrch.cpp.

Referenced by processCollator().

◆ opt_help

UBool opt_help = 0

Definition at line 52 of file strsrch.cpp.

Referenced by main().

◆ opt_level

int opt_level = 0

Definition at line 61 of file strsrch.cpp.

Referenced by processCollator().

◆ opt_locale

char* opt_locale = "en_US"

Command line option variables These global variables are set according to the options specified on the command line by the user.

Definition at line 50 of file strsrch.cpp.

Referenced by processCollator().

◆ opt_lower

UBool opt_lower = 0

Definition at line 56 of file strsrch.cpp.

Referenced by processCollator().

◆ opt_norm

UBool opt_norm = 0

Definition at line 53 of file strsrch.cpp.

Referenced by processCollator().

◆ opt_overlap

UBool opt_overlap = 0

Definition at line 59 of file strsrch.cpp.

Referenced by processStringSearch().

◆ opt_pattern

char* opt_pattern = "Unicode"

Definition at line 63 of file strsrch.cpp.

Referenced by main(), and processStringSearch().

◆ opt_rules

char* opt_rules = 0

Definition at line 51 of file strsrch.cpp.

Referenced by processCollator().

◆ opt_shifted

UBool opt_shifted = 0

Definition at line 55 of file strsrch.cpp.

Referenced by processCollator().

◆ opt_source

char* opt_source = "International Components for Unicode"

Definition at line 62 of file strsrch.cpp.

Referenced by main(), and processStringSearch().

◆ opt_upper

UBool opt_upper = 0

Definition at line 57 of file strsrch.cpp.

Referenced by processCollator().

◆ opts

OptSpec opts[]
Initial value:
= {
{"-locale", OptSpec::STRING, &opt_locale},
{"-rules", OptSpec::STRING, &opt_rules},
{"-source", OptSpec::STRING, &opt_source},
{"-pattern", OptSpec::STRING, &opt_pattern},
{"-norm", OptSpec::FLAG, &opt_norm},
{"-french", OptSpec::FLAG, &opt_french},
{"-shifted", OptSpec::FLAG, &opt_shifted},
{"-lower", OptSpec::FLAG, &opt_lower},
{"-upper", OptSpec::FLAG, &opt_upper},
{"-case", OptSpec::FLAG, &opt_case},
{"-level", OptSpec::NUM, &opt_level},
{"-overlap", OptSpec::FLAG, &opt_overlap},
{"-canonical", OptSpec::FLAG, &opt_canonical},
{"-help", OptSpec::FLAG, &opt_help},
{0, OptSpec::FLAG, 0}
}
UBool opt_upper
Definition: strsrch.cpp:57
char * opt_locale
Definition: strsrch.cpp:50
UBool opt_overlap
Definition: strsrch.cpp:59
UBool opt_lower
Definition: strsrch.cpp:56
char * opt_source
Definition: strsrch.cpp:62
char * opt_pattern
Definition: strsrch.cpp:63
char * opt_rules
Definition: strsrch.cpp:51
UBool opt_canonical
Definition: strsrch.cpp:60
UBool opt_norm
Definition: strsrch.cpp:53
UBool opt_help
Definition: strsrch.cpp:52
UBool opt_shifted
Definition: strsrch.cpp:55
int opt_level
Definition: strsrch.cpp:61
UBool opt_french
Definition: strsrch.cpp:54
UBool opt_case
Definition: strsrch.cpp:58
@ FLAG
Definition: coll.cpp:67
@ NUM
Definition: coll.cpp:67
@ STRING
Definition: coll.cpp:67

Definition at line 79 of file strsrch.cpp.

Referenced by main(), and processOptions().

◆ pattern

UChar pattern[100]

Definition at line 68 of file strsrch.cpp.

◆ rules

UChar rules[100]

Definition at line 66 of file strsrch.cpp.

Referenced by RuleBasedTransliterator::_construct(), addCollation(), Compiler::associateItems(), Compiler::buildTable(), RBBIRuleBuilder::createRuleBasedBreakIterator(), number::impl::LongNameHandler::forCompoundUnit(), number::impl::LongNameHandler::forCurrencyLongNames(), QuantityFormatter::format(), QuantityFormatter::formatAndSelect(), number::impl::MixedUnitLongNameHandler::forMeasureUnit(), number::impl::LongNameHandler::forMeasureUnit(), number::impl::LongNameMultiplexer::forMeasureUnits(), g___ChainingSubTable1(), g___ChainingSubTable2(), g___ContextSubTable1(), g___ContextSubTable2(), DayPeriodRules::getInstance(), number::impl::MixedUnitLongNameHandler::getMixedUnitModifier(), number::impl::utils::getPluralSafe(), U_NAMESPACE_BEGIN::BundleImporter::getRules(), number::impl::utils::getStandardPlural(), TransliteratorRegistry::instantiateEntry(), print_rule_data_base(), print_variable_data_base(), processCollator(), number::impl::LongNameHandler::processQuantity(), DayPeriodRulesDataSink::processRules(), DayPeriodRulesDataSink::put(), DayPeriodRulesCountSink::put(), RuleBasedTransliterator::RuleBasedTransliterator(), RuleChain::select(), U_NAMESPACE_USE::select(), QuantityFormatter::selectPlural(), Compiler::setGroupPointers(), number::impl::MutablePatternModifier::setSymbols(), Compiler::sortRules(), RBBIRuleScanner::stripRules(), ubrk_openRules_68(), ucol_getRules_68(), ucol_getRulesEx_68(), ucol_openRules_68(), uprv_syntaxError_68(), utrans_open_68(), utrans_openU_68(), and wsort().

◆ search

Definition at line 65 of file strsrch.cpp.

◆ source

UChar source[100]

Definition at line 67 of file strsrch.cpp.