当前位置: 首页>>代码示例>>C++>>正文


C++ UNICODE_STRING_SIMPLE函数代码示例

本文整理汇总了C++中UNICODE_STRING_SIMPLE函数的典型用法代码示例。如果您正苦于以下问题:C++ UNICODE_STRING_SIMPLE函数的具体用法?C++ UNICODE_STRING_SIMPLE怎么用?C++ UNICODE_STRING_SIMPLE使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了UNICODE_STRING_SIMPLE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ExpressionCompletionMatchesFixtureClass

    ExpressionCompletionMatchesFixtureClass()
        : FileTestFixtureClass(wxT("tag-cache"))
        , SqliteTestFixtureClass(t4p::ResourceSqlSchemaAsset())
        , TagCache()
        , GlobalFile(wxT("src") + wxString(wxFileName::GetPathSeparator()) + wxT("global.php"))
        , File1(wxT("src") + wxString(wxFileName::GetPathSeparator()) + wxT("file1.php"))
        , File2(wxT("src") + wxString(wxFileName::GetPathSeparator()) + wxT("file2.php"))
        , GlobalCode()
        , Code1()
        , Code2()
        , DoDuckTyping(false)
        , DoFullyQualifiedMatchOnly(false)
        , Scope()
        , ParsedVariable(Scope)
        , SourceDirs()
        , VariableMatches()
        , TagMatches()
        , Error()
        , Search()
        , PhpFileExtensions()
        , MiscFileExtensions() {
        CreateSubDirectory(wxT("src"));
        Search.Init(TestProjectDir + wxT("src"));
        PhpFileExtensions.push_back(wxT("*.php"));
        Scope.ClassName = UNICODE_STRING_SIMPLE("");
        Scope.MethodName = UNICODE_STRING_SIMPLE("");
        Session1 = new soci::session(*soci::factory_sqlite3(), ":memory:");
        CreateDatabase(*Session1, t4p::ResourceSqlSchemaAsset());

        wxFileName srcDir;
        srcDir.AssignDir(TestProjectDir + wxT("src"));
        SourceDirs.push_back(srcDir);
    }
开发者ID:adjustive,项目名称:triumph4php,代码行数:33,代码来源:TagCacheTestClass.cpp

示例2: DictionaryBreakEngine

KhmerBreakEngine::KhmerBreakEngine(DictionaryMatcher *adoptDictionary, UErrorCode &status)
    : DictionaryBreakEngine((1 << UBRK_WORD) | (1 << UBRK_LINE)),
      fDictionary(adoptDictionary)
{
    fKhmerWordSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Khmr:]&[:LineBreak=SA:]]"), status);
    if (U_SUCCESS(status)) {
        setCharacters(fKhmerWordSet);
    }
    fMarkSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Khmr:]&[:LineBreak=SA:]&[:M:]]"), status);
    fMarkSet.add(0x0020);
    fEndWordSet = fKhmerWordSet;
    fBeginWordSet.add(0x1780, 0x17B3);
    //fBeginWordSet.add(0x17A3, 0x17A4);      // deprecated vowels
    //fEndWordSet.remove(0x17A5, 0x17A9);     // Khmer independent vowels that can't end a word
    //fEndWordSet.remove(0x17B2);             // Khmer independent vowel that can't end a word
    fEndWordSet.remove(0x17D2);             // KHMER SIGN COENG that combines some following characters
    //fEndWordSet.remove(0x17B6, 0x17C5);     // Remove dependent vowels
//    fEndWordSet.remove(0x0E31);             // MAI HAN-AKAT
//    fEndWordSet.remove(0x0E40, 0x0E44);     // SARA E through SARA AI MAIMALAI
//    fBeginWordSet.add(0x0E01, 0x0E2E);      // KO KAI through HO NOKHUK
//    fBeginWordSet.add(0x0E40, 0x0E44);      // SARA E through SARA AI MAIMALAI
//    fSuffixSet.add(THAI_PAIYANNOI);
//    fSuffixSet.add(THAI_MAIYAMOK);

    // Compact for caching.
    fMarkSet.compact();
    fEndWordSet.compact();
    fBeginWordSet.compact();
//    fSuffixSet.compact();
}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:30,代码来源:dictbe.cpp

示例3: tagSearch

std::vector<t4p::PhpTagClass> t4p::TagCacheClass::AllMemberTags(const UnicodeString& fullyQualifiedClassName,
        int fileTagId, std::vector<wxFileName>& sourceDirs) {
    std::vector<t4p::PhpTagClass> allMatches;

    // add the double colon so that we search for all members
    // first search for all members of the given class that is also in the given file
    t4p::TagSearchClass tagSearch(fullyQualifiedClassName + UNICODE_STRING_SIMPLE("::"));
    tagSearch.SetFileItemId(fileTagId);
    tagSearch.SetTraits(TagFinderList->ClassUsedTraits(fullyQualifiedClassName, tagSearch.GetParentClasses(),
                        tagSearch.GetMethodName(), sourceDirs));

    TagFinderList->NearMatchesFromAll(tagSearch, allMatches, sourceDirs);

    // now get all parent class  (look in all files) also look for inherited members and traits
    UnicodeString parentClassName  = TagFinderList->ParentClassName(fullyQualifiedClassName, fileTagId);
    if (!parentClassName.isEmpty()) {
        t4p::TagSearchClass hierarchySearch(parentClassName + UNICODE_STRING_SIMPLE("::"));

        hierarchySearch.SetParentClasses(TagFinderList->ClassParents(parentClassName, hierarchySearch.GetMethodName()));
        hierarchySearch.SetTraits(TagFinderList->ClassUsedTraits(parentClassName, hierarchySearch.GetParentClasses(),
                                  hierarchySearch.GetMethodName(), sourceDirs));

        // search classes from the enabled source directories only
        hierarchySearch.SetSourceDirs(sourceDirs);

        TagFinderList->NearMatchesFromAll(hierarchySearch, allMatches, sourceDirs);
        TagFinderList->NearMatchTraitAliasesFromAll(hierarchySearch, allMatches);
    }
    return allMatches;
}
开发者ID:62BRAINS,项目名称:triumph4php,代码行数:30,代码来源:TagCacheClass.cpp

示例4: errorCode

void UTS46Test::TestNotSTD3() {
    IcuTestErrorCode errorCode(*this, "TestNotSTD3()");
    char buffer[400];
    LocalPointer<IDNA> not3(IDNA::createUTS46Instance(UIDNA_CHECK_BIDI, errorCode));
    if(errorCode.isFailure()) {
        return;
    }
    UnicodeString input=UNICODE_STRING_SIMPLE("\\u0000A_2+2=4\\u000A.e\\u00DFen.net").unescape();
    UnicodeString result;
    IDNAInfo info;
    if( not3->nameToUnicode(input, result, info, errorCode)!=
            UNICODE_STRING_SIMPLE("\\u0000a_2+2=4\\u000A.essen.net").unescape() ||
        info.hasErrors()
    ) {
        prettify(result).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
        errln("notSTD3.nameToUnicode(non-LDH ASCII) unexpected errors %04lx string %s",
              (long)info.getErrors(), buffer);
    }
    // A space (BiDi class WS) is not allowed in a BiDi domain name.
    input=UNICODE_STRING_SIMPLE("a z.xn--4db.edu");
    not3->nameToASCII(input, result, info, errorCode);
    if(result!=input || info.getErrors()!=UIDNA_ERROR_BIDI) {
        errln("notSTD3.nameToASCII(ASCII-with-space.alef.edu) failed");
    }
    // Characters that are canonically equivalent to sequences with non-LDH ASCII.
    input=UNICODE_STRING_SIMPLE("a\\u2260b\\u226Ec\\u226Fd").unescape();
    not3->nameToUnicode(input, result, info, errorCode);
    if(result!=input || info.hasErrors()) {
        prettify(result).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
        errln("notSTD3.nameToUnicode(equiv to non-LDH ASCII) unexpected errors %04lx string %s",
              (long)info.getErrors(), buffer);
    }
}
开发者ID:cyrusimap,项目名称:icu4c,代码行数:33,代码来源:uts46test.cpp

示例5: TEST_FIXTURE

    TEST_FIXTURE(ExpressionCompletionMatchesFixtureClass, TagMatchesWithStaleMatches) {
        // create a class in global file with methodA
        // file2 will use the class from global file; file2 will be registered
        // then global file will be registered with file2 (invalidating methodA)
        // perform a search
        // methodA should not be a hit since it has been removed
        GlobalCode = wxT("<?php class ActionMy   { function methodA() {} }");
        Code1 = UNICODE_STRING_SIMPLE("<?php $action = new ActionMy(); ");
        Code2 = UNICODE_STRING_SIMPLE("<?php class ActionMy   { function methodB() {} }");

        CreateFixtureFile(GlobalFile, GlobalCode);

        t4p::WorkingCacheClass* cache1 = CreateWorkingCache(File1, Code1);
        t4p::TagFinderListClass* cache2 = CreateTagFinderList(wxT("src"));

        CHECK(TagCache.RegisterWorking(File1, cache1));
        TagCache.RegisterGlobal(cache2);

        ToProperty(UNICODE_STRING_SIMPLE("$action"), UNICODE_STRING_SIMPLE("methodA"));
        TagCache.ResourceMatches(File1, ParsedVariable, Scope, SourceDirs,
                                 TagMatches, DoDuckTyping, DoFullyQualifiedMatchOnly, Error);
        CHECK_VECTOR_SIZE(1, TagMatches);
        CHECK_UNISTR_EQUALS("methodA", TagMatches[0].Identifier);
        CHECK_UNISTR_EQUALS("ActionMy", TagMatches[0].ClassName);

        // now update the code by creating a working version of the global code.
        // ie. the user opening a file.
        t4p::WorkingCacheClass* cache3 = CreateWorkingCache(GlobalFile, Code2);
        CHECK(TagCache.RegisterWorking(GlobalFile, cache3));

        TagMatches.clear();
        TagCache.ResourceMatches(GlobalFile, ParsedVariable, Scope, SourceDirs,
                                 TagMatches, DoDuckTyping, DoFullyQualifiedMatchOnly, Error);
        CHECK_VECTOR_SIZE(0, TagMatches);
    }
开发者ID:adjustive,项目名称:triumph4php,代码行数:35,代码来源:TagCacheTestClass.cpp

示例6: Transliterator

TitlecaseTransliterator::TitlecaseTransliterator(const Locale& theLoc) :
    Transliterator(_ID, 0),
    loc(theLoc), 
    buffer(0)
{
    buffer = (UChar *)uprv_malloc(u_getMaxCaseExpansion()*sizeof(buffer[0]));
    // Need to look back 2 characters in the case of "can't"
    setMaximumContextLength(2);

    umtx_lock(NULL);
    UBool f = (SKIP == NULL);
    umtx_unlock(NULL);

    if (f) {
        UErrorCode ec = U_ZERO_ERROR;
        UnicodeSet* skip =
            new UnicodeSet(UNICODE_STRING_SIMPLE("[\\u00AD \\u2019 \\' [:Mn:] [:Me:] [:Cf:] [:Lm:] [:Sk:]]"), ec);
        UnicodeSet* cased =
            new UnicodeSet(UNICODE_STRING_SIMPLE("[[:Lu:] [:Ll:] [:Lt:]]"), ec);
        if (skip != NULL && cased != NULL && U_SUCCESS(ec)) {
            umtx_lock(NULL);
            if (SKIP == NULL) {
                SKIP = skip;
                CASED = cased;
                skip = cased = NULL;
            }
            umtx_unlock(NULL);
        }
        delete skip;
        delete cased;
        ucln_i18n_registerCleanup();
    }
}
开发者ID:gitpan,项目名称:ponie,代码行数:33,代码来源:titletrn.cpp

示例7: DictionaryBreakEngine

CjkBreakEngine::CjkBreakEngine(const TrieWordDictionary *adoptDictionary, LanguageType type, UErrorCode &status)
: DictionaryBreakEngine(1<<UBRK_WORD), fDictionary(adoptDictionary){
    if (!adoptDictionary->getValued()) {
        status = U_ILLEGAL_ARGUMENT_ERROR;
        return;
    }

    // Korean dictionary only includes Hangul syllables
    fHangulWordSet.applyPattern(UNICODE_STRING_SIMPLE("[\\uac00-\\ud7a3]"), status);
    fHanWordSet.applyPattern(UNICODE_STRING_SIMPLE("[:Han:]"), status);
    fKatakanaWordSet.applyPattern(UNICODE_STRING_SIMPLE("[[:Katakana:]\\uff9e\\uff9f]"), status);
    fHiraganaWordSet.applyPattern(UNICODE_STRING_SIMPLE("[:Hiragana:]"), status);

    if (U_SUCCESS(status)) {
        // handle Korean and Japanese/Chinese using different dictionaries
        if (type == kKorean) {
            setCharacters(fHangulWordSet);
        } else { //Chinese and Japanese
            UnicodeSet cjSet;
            cjSet.addAll(fHanWordSet);
            cjSet.addAll(fKatakanaWordSet);
            cjSet.addAll(fHiraganaWordSet);
            cjSet.add(UNICODE_STRING_SIMPLE("\\uff70\\u30fc"));
            setCharacters(cjSet);
        }
    }
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:27,代码来源:dictbe.cpp

示例8: UNICODE_STRING_SIMPLE

void
RuleBasedNumberFormat::initDefaultRuleSet()
{
    defaultRuleSet = NULL;
    if (!ruleSets) {
      return;
    }

    const UnicodeString spellout = UNICODE_STRING_SIMPLE("%spellout-numbering");
    const UnicodeString ordinal = UNICODE_STRING_SIMPLE("%digits-ordinal");
    const UnicodeString duration = UNICODE_STRING_SIMPLE("%duration");

    NFRuleSet**p = &ruleSets[0];
    while (*p) {
        if ((*p)->isNamed(spellout) || (*p)->isNamed(ordinal) || (*p)->isNamed(duration)) {
            defaultRuleSet = *p;
            return;
        } else {
            ++p;
        }
    }

    defaultRuleSet = *--p;
    if (!defaultRuleSet->isPublic()) {
        while (p != ruleSets) {
            if ((*--p)->isPublic()) {
                defaultRuleSet = *p;
                break;
            }
        }
    }
}
开发者ID:thlorenz,项目名称:chromium-deps-icu52,代码行数:32,代码来源:rbnf.cpp

示例9: TEST_FIXTURE

    TEST_FIXTURE(MysqlResourceFinderFixtureClass, FindColumns) {
        std::string query = "CREATE TABLE web_users(idIUser int);";
        CHECK(DatabaseTestFixtureClass::Exec(query));
        query = "CREATE TABLE service_names(idIServiceName int);";
        CHECK(DatabaseTestFixtureClass::Exec(query));
        query = "CREATE TABLE service_locations(idIServiceLocation int);";
        CHECK(DatabaseTestFixtureClass::Exec(query));
        query = "CREATE TABLE deleted_users(idIUser int, idIDeletedBy int);";
        CHECK(DatabaseTestFixtureClass::Exec(query));
        UnicodeString error;
        CHECK(Fetcher.Fetch(DatabaseTag, error));

        std::vector<UnicodeString> columns = Finder.FindColumns(DatabaseTag, UNICODE_STRING_SIMPLE("idIServiceL"));
        CHECK_VECTOR_SIZE(1, columns);
        CHECK_UNISTR_EQUALS_NO_CASE("idIServiceLocation", columns[0]);


        columns = Finder.FindColumns(DatabaseTag, UNICODE_STRING_SIMPLE("idI"));

        CHECK_VECTOR_SIZE(4, columns);
        CHECK_UNISTR_EQUALS_NO_CASE("idIDeletedBy", columns[0]);
        CHECK_UNISTR_EQUALS_NO_CASE("idIServiceLocation", columns[1]);
        CHECK_UNISTR_EQUALS_NO_CASE("idIServiceName", columns[2]);
        CHECK_UNISTR_EQUALS_NO_CASE("idIUser", columns[3]);
    }
开发者ID:62BRAINS,项目名称:triumph4php,代码行数:25,代码来源:SqlResourceFinderTestClass.cpp

示例10: cf

void
StringCaseTest::TestFullCaseFoldingIterator() {
    UnicodeString ffi=UNICODE_STRING_SIMPLE("ffi");
    UnicodeString ss=UNICODE_STRING_SIMPLE("ss");
    FullCaseFoldingIterator iter;
    int32_t count=0;
    int32_t countSpecific=0;
    UChar32 c;
    UnicodeString full;
    while((c=iter.next(full))>=0) {
        ++count;
        // Check that the full Case_Folding has more than 1 code point.
        if(!full.hasMoreChar32Than(0, 0x7fffffff, 1)) {
            errln("error: FullCaseFoldingIterator.next()=U+%04lX full Case_Folding has at most 1 code point", (long)c);
            continue;
        }
        // Check that full == Case_Folding(c).
        UnicodeString cf(c);
        cf.foldCase();
        if(full!=cf) {
            errln("error: FullCaseFoldingIterator.next()=U+%04lX full Case_Folding != cf(c)", (long)c);
            continue;
        }
        // Spot-check a couple of specific cases.
        if((full==ffi && c==0xfb03) || (full==ss && (c==0xdf || c==0x1e9e))) {
            ++countSpecific;
        }
    }
    if(countSpecific!=3) {
        errln("error: FullCaseFoldingIterator did not yield exactly the expected specific cases");
    }
    if(count<70) {
        errln("error: FullCaseFoldingIterator yielded only %d (cp, full) pairs", (int)count);
    }
}
开发者ID:CoherentLabs,项目名称:CoherentWebCoreDependencies,代码行数:35,代码来源:strcase.cpp

示例11: while

void PluralRulesTest::testGetSamples() {
  // TODO: fix samples, re-enable this test.

  // no get functional equivalent API in ICU4C, so just
  // test every locale...
  UErrorCode status = U_ZERO_ERROR;
  int32_t numLocales;
  const Locale* locales = Locale::getAvailableLocales(numLocales);

  double values[1000];
  for (int32_t i = 0; U_SUCCESS(status) && i < numLocales; ++i) {
    PluralRules *rules = PluralRules::forLocale(locales[i], status);
    if (U_FAILURE(status)) {
      break;
    }
    StringEnumeration *keywords = rules->getKeywords(status);
    if (U_FAILURE(status)) {
      delete rules;
      break;
    }
    const UnicodeString* keyword;
    while (NULL != (keyword = keywords->snext(status))) {
      int32_t count = rules->getSamples(*keyword, values, LENGTHOF(values), status);
      if (U_FAILURE(status)) {
        errln(UNICODE_STRING_SIMPLE("getSamples() failed for locale ") +
              locales[i].getName() +
              UNICODE_STRING_SIMPLE(", keyword ") + *keyword);
        continue;
      }
      if (count == 0) {
        // TODO: Lots of these. 
        //   errln(UNICODE_STRING_SIMPLE("no samples for keyword ") + *keyword + UNICODE_STRING_SIMPLE(" in locale ") + locales[i].getName() );
      }
      if (count > LENGTHOF(values)) {
        errln(UNICODE_STRING_SIMPLE("getSamples()=") + count +
              UNICODE_STRING_SIMPLE(", too many values, for locale ") +
              locales[i].getName() +
              UNICODE_STRING_SIMPLE(", keyword ") + *keyword);
        count = LENGTHOF(values);
      }
      for (int32_t j = 0; j < count; ++j) {
        if (values[j] == UPLRULES_NO_UNIQUE_VALUE) {
          errln("got 'no unique value' among values");
        } else {
          UnicodeString resultKeyword = rules->select(values[j]);
          // if (strcmp(locales[i].getName(), "uk") == 0) {    // Debug only.
          //     std::cout << "  uk " << US(resultKeyword).cstr() << " " << values[j] << std::endl;
          // }
          if (*keyword != resultKeyword) {
            errln("file %s, line %d, Locale %s, sample for keyword \"%s\":  %g, select(%g) returns keyword \"%s\"",
                __FILE__, __LINE__, locales[i].getName(), US(*keyword).cstr(), values[j], values[j], US(resultKeyword).cstr());
          }
        }
      }
    }
    delete keywords;
    delete rules;
  }
}
开发者ID:CoherentLabs,项目名称:CoherentWebCoreDependencies,代码行数:59,代码来源:plurults.cpp

示例12: DatabaseTagTestFixtureClass

 DatabaseTagTestFixtureClass()
     : DatabaseTestFixtureClass("database_tag")
     , DatabaseTag() {
     DatabaseTag.Schema = UNICODE_STRING_SIMPLE("database_tag");
     DatabaseTag.Host = UNICODE_STRING_SIMPLE("127.0.0.1");
     DatabaseTag.User = t4p::CharToIcu(UserName().c_str());
     DatabaseTag.Password = t4p::CharToIcu(Password().c_str());
 }
开发者ID:62BRAINS,项目名称:triumph4php,代码行数:8,代码来源:DatabaseTagTestClass.cpp

示例13: U_ASSERT

/**
 * Iterate through the given iterator, checking to see that all the strings
 * in the expected array are present.
 * @param expected array of strings we expect to see, or NULL
 * @param expectedCount number of elements of expected, or 0
 */
int32_t CollationServiceTest::checkStringEnumeration(const char* msg,
                                                     StringEnumeration& iter,
                                                     const char** expected,
                                                     int32_t expectedCount) {
    UErrorCode ec = U_ZERO_ERROR;
    U_ASSERT(expectedCount >= 0 && expectedCount < 31); // [sic] 31 not 32
    int32_t i = 0, idxAfterReset = 0, n = iter.count(ec);
    assertSuccess("count", ec);
    UnicodeString buf, buffAfterReset;
    int32_t seenMask = 0;
    for (;; ++i) {
        const UnicodeString* s = iter.snext(ec);
        if (!assertSuccess("snext", ec) || s == NULL)
            break;
        if (i != 0)
            buf.append(UNICODE_STRING_SIMPLE(", "));
        buf.append(*s);
        // check expected list
        for (int32_t j=0, bit=1; j<expectedCount; ++j, bit<<=1) {
            if ((seenMask&bit)==0) {
                UnicodeString exp(expected[j], (char*)NULL);
                if (*s == exp) {
                    seenMask |= bit;
                    logln((UnicodeString)"Ok: \"" + exp + "\" seen");
                }
            }
        }
    }
    // can't get pesky operator+(const US&, foo) to cooperate; use toString
#if !UCONFIG_NO_FORMATTING
    logln(UnicodeString() + msg + " = [" + buf + "] (" + toString(i) + ")");
#else
    logln(UnicodeString() + msg + " = [" + buf + "] (??? NO_FORMATTING)");
#endif
    assertTrue("count verified", i==n);
    iter.reset(ec);
    for (;; ++idxAfterReset) {
        const UChar *s = iter.unext(NULL, ec);
        if (!assertSuccess("unext", ec) || s == NULL)
            break;
        if (idxAfterReset != 0)
            buffAfterReset.append(UNICODE_STRING_SIMPLE(", "));
        buffAfterReset.append(s);
    }
    assertTrue("idxAfterReset verified", idxAfterReset==n);
    assertTrue("buffAfterReset verified", buffAfterReset==buf);
    // did we see all expected strings?
    if (((1<<expectedCount)-1) != seenMask) {
        for (int32_t j=0, bit=1; j<expectedCount; ++j, bit<<=1) {
            if ((seenMask&bit)==0) {
                errln((UnicodeString)"FAIL: \"" + expected[j] + "\" not seen");
            }
        }
    }
    return n;
}
开发者ID:ACSOP,项目名称:android_external_icu4c,代码行数:62,代码来源:svccoll.cpp

示例14: wxDynamicCast

void t4p::PhpCodeCompletionProviderClass::OnAutoCompletionSelected(wxStyledTextEvent& event) {
    wxStyledTextCtrl* txtCtrl = wxDynamicCast(event.GetEventObject(), wxStyledTextCtrl);
    if (!txtCtrl) {
        return;
    }
    t4p::CodeControlClass* ctrl = (t4p::CodeControlClass*)txtCtrl;

    if (!AutoCompletionResourceMatches.empty()) {
        UnicodeString selected = t4p::WxToIcu(event.GetText());

        bool handled = false;
        for (size_t i = 0; i < AutoCompletionResourceMatches.size(); ++i) {
            t4p::PhpTagClass res = AutoCompletionResourceMatches[i];
            if (res.Identifier == selected) {
                // user had selected  a function /method name; let's add the
                // parenthesis and show the call tip
                ctrl->AutoCompCancel();
                wxString selected = event.GetText();
                int startPos = ctrl->WordStartPosition(ctrl->GetCurrentPos(), true);
                ctrl->SetSelection(startPos, ctrl->GetCurrentPos());
                wxString status;
                if ((t4p::PhpTagClass::FUNCTION == res.Type || t4p::PhpTagClass::METHOD == res.Type) && !res.HasParameters()) {
                    ctrl->ReplaceSelection(selected + wxT("()"));
                    ctrl->HandleCallTip(0, true);
                } else if (t4p::PhpTagClass::FUNCTION == res.Type || t4p::PhpTagClass::METHOD == res.Type) {
                    ctrl->ReplaceSelection(selected + wxT("("));
                    ctrl->HandleCallTip(0, true);
                } else {
                    ctrl->ReplaceSelection(selected);
                }
                handled = true;
                break;
            }
        }
        if (!handled) {
            // complete the PHP alternative syntax for control structures
            // ie endif endwhile endfor endforeach endswitch
            // Scintilla cannot handle semicolons in keywords; we will add the semicolon here
            if (selected.caseCompare(UNICODE_STRING_SIMPLE("endif"), 0) == 0 ||
                    selected.caseCompare(UNICODE_STRING_SIMPLE("endwhile"), 0) == 0 ||
                    selected.caseCompare(UNICODE_STRING_SIMPLE("endfor"), 0) == 0 ||
                    selected.caseCompare(UNICODE_STRING_SIMPLE("endforeach"), 0) == 0 ||
                    selected.caseCompare(UNICODE_STRING_SIMPLE("endswitch"), 0) == 0) {
                ctrl->AutoCompCancel();
                wxString selected = event.GetText();
                int startPos = ctrl->WordStartPosition(ctrl->GetCurrentPos(), true);
                ctrl->SetSelection(startPos, ctrl->GetCurrentPos());
                ctrl->ReplaceSelection(selected + wxT(";"));
            }
        }
    }
}
开发者ID:62BRAINS,项目名称:triumph4php,代码行数:52,代码来源:PhpCodeCompletionViewClass.cpp

示例15: MysqlResourceFinderFixtureClass

    MysqlResourceFinderFixtureClass()
        : DatabaseTestFixtureClass("sql_resource_finder")
        , SqliteTestFixtureClass(t4p::ResourceSqlSchemaAsset())
        , DatabaseTag()
        , Fetcher(SqliteTestFixtureClass::Session)
        , Finder(SqliteTestFixtureClass::Session) {
        DatabaseTag.Driver = t4p::DatabaseTagClass::MYSQL;
        DatabaseTag.Schema = UNICODE_STRING_SIMPLE("sql_resource_finder");

        // user name, pwd are #defines come from the premake script premake_opts.lua
        DatabaseTag.Host = UNICODE_STRING_SIMPLE("127.0.0.1");
        DatabaseTag.User = t4p::CharToIcu(UserName().c_str());
        DatabaseTag.Password = t4p::CharToIcu(Password().c_str());
    }
开发者ID:62BRAINS,项目名称:triumph4php,代码行数:14,代码来源:SqlResourceFinderTestClass.cpp


注:本文中的UNICODE_STRING_SIMPLE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。