VirtualBox

儲存庫 vbox 的更動 67650


忽略:
時間撮記:
2017-6-27 下午04:55:17 (7 年 以前)
作者:
vboxsync
訊息:

IPRT: Added const char * variant of RTCString::contains.

位置:
trunk
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/include/iprt/cpp/ministring.h

    r67645 r67650  
    290290
    291291    /**
    292      * Assigns a copy of pcsz to "this".
     292     * Assigns a copy of pcsz to @a this.
    293293     *
    294294     * @param   pcsz            The source string.
     
    310310
    311311    /**
    312      * Assigns a copy of s to "this".
     312     * Assigns a copy of s to @a this.
    313313     *
    314314     * @param   s               The source string.
     
    358358
    359359    /**
    360      * Appends the string "that" to "this".
     360     * Appends the string @a that to @a this.
    361361     *
    362362     * @param   that            The string to append.
     
    369369
    370370    /**
    371      * Appends the string "that" to "this".
     371     * Appends the string @a that to @a this.
    372372     *
    373373     * @param   pszThat         The C string to append.
     
    380380
    381381    /**
    382      * Appends the given character to "this".
     382     * Appends the given character to @a this.
    383383     *
    384384     * @param   ch              The character to append.
     
    391391
    392392    /**
    393      * Appends the given unicode code point to "this".
     393     * Appends the given unicode code point to @a this.
    394394     *
    395395     * @param   uc              The unicode code point to append.
     
    759759
    760760    /**
    761      * Returns a substring of "this" as a new Utf8Str.
     761     * Returns a substring of @a this as a new Utf8Str.
    762762     *
    763763     * Works exactly like its equivalent in std::string. With the default
     
    767767     * used in conjunction with find() and length(), this will work.
    768768     *
    769      * @param   pos             Index of first byte offset to copy from "this", counting from 0.
     769     * @param   pos             Index of first byte offset to copy from @a this,
     770     *                          counting from 0.
    770771     * @param   n               Number of bytes to copy, starting with the one at "pos".
    771772     *                          The copying will stop if the null terminator is encountered before
     
    778779
    779780    /**
    780      * Returns a substring of "this" as a new Utf8Str. As opposed to substr(),
    781      * this variant takes codepoint offsets instead of byte offsets.
     781     * Returns a substring of @a this as a new Utf8Str. As opposed to substr(), this
     782     * variant takes codepoint offsets instead of byte offsets.
    782783     *
    783784     * @param   pos             Index of first unicode codepoint to copy from
    784      *                          "this", counting from 0.
     785     *                          @a this, counting from 0.
    785786     * @param   n               Number of unicode codepoints to copy, starting with
    786787     *                          the one at "pos".  The copying will stop if the null
     
    791792
    792793    /**
    793      * Returns true if "this" ends with "that".
     794     * Returns true if @a this ends with @a that.
    794795     *
    795796     * @param   that    Suffix to test for.
     
    800801
    801802    /**
    802      * Returns true if "this" begins with "that".
     803     * Returns true if @a this begins with @a that.
    803804     * @param   that    Prefix to test for.
    804805     * @param   cs      Case sensitivity selector.
     
    808809
    809810    /**
    810      * Returns true if "this" contains "that" (strstr).
     811     * Returns true if @a this contains @a that (strstr).
    811812     *
    812813     * @param   that    Substring to look for.
    813814     * @param   cs      Case sensitivity selector.
    814      * @returns true if match, false if mismatch.
     815     * @returns true if found, false if not found.
    815816     */
    816817    bool contains(const RTCString &that, CaseSensitivity cs = CaseSensitive) const;
     818
     819    /**
     820     * Returns true if @a this contains @a pszNeedle (strstr).
     821     *
     822     * @param   pszNeedle   Substring to look for.
     823     * @param   cs          Case sensitivity selector.
     824     * @returns true if found, false if not found.
     825     */
     826    bool contains(const char *pszNeedle, CaseSensitivity cs = CaseSensitive) const;
    817827
    818828    /**
  • trunk/src/VBox/Runtime/common/string/ministring.cpp

    r67645 r67650  
    372372}
    373373
     374bool RTCString::contains(const char *pszNeedle, CaseSensitivity cs /*= CaseSensitive*/) const
     375{
     376    /** @todo r-bird: Not checking for NULL strings like startsWith does (and
     377     *        endsWith only does half way). */
     378    if (cs == CaseSensitive)
     379        return ::RTStrStr(m_psz, pszNeedle) != NULL;
     380    return ::RTStrIStr(m_psz, pszNeedle) != NULL;
     381}
     382
    374383int RTCString::toInt(uint64_t &i) const
    375384{
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette