Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1830 for code/trunk


Ignore:
Timestamp:
Sep 25, 2008, 12:45:32 AM (16 years ago)
Author:
landauf
Message:

small change in a string function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/util/String.cc

    r1791 r1830  
    5353    while ((pos = (*str).find("\t")) < (*str).length())
    5454        (*str).erase(pos, 1);
     55    while ((pos = (*str).find("\n")) < (*str).length())
     56        (*str).erase(pos, 1);
    5557}
    5658
     
    121123    while ((quote = getNextQuote(str, quote + 1)) < pos)
    122124    {
     125        if (quote == pos)
     126            return false;
    123127        quotecount++;
    124128    }
     
    131135
    132136/**
    133     @brief Returns true if the string contains something like '..."between quotes"...'
     137    @brief Returns true if the string contains something like '..."between quotes"...'.
    134138    @param The string
    135139    @return True if there is something between quotes
     
    158162
    159163/**
    160     @brief Removes enclosing quotes if available.
     164    @brief Removes enclosing quotes if available (including whitespaces at the outside of the quotes).
    161165    @brief str The string to strip
    162166    @return The string with removed quotes
     
    198202
    199203/**
    200     @brief Removes enclosing {braces}.
     204    @brief Removes enclosing {braces} (braces must be exactly on the beginning and the end of the string).
    201205    @param str The string to strip
    202206    @return The striped string
     
    213217
    214218/**
    215     @brief Determines if a string in is a comment.
     219    @brief Determines if a string is a comment (starts with a comment-symbol).
    216220    @param str The string to check
    217221    @return True = it's a comment
     
    384388
    385389/**
    386     @brief compares two strings without ignoring the case
    387     @param s1 first string
    388     @param s2 second string
     390    @brief Compares two strings ignoring different casing.
     391    @param s1 First string
     392    @param s2 Second string
    389393*/
    390394int nocaseCmp(const std::string& s1, const std::string& s2)
     
    412416
    413417/**
    414     @brief compares two strings without ignoring the case
    415     @param s1 first string
    416     @param s2 second string
    417     @param len how far from the beginning to start.
     418    @brief Compares the first 'len' chars of two strings ignoring different casing.
     419    @param s1 First string
     420    @param s2 Second string
     421    @param len Maximal number of chars to compare
    418422*/
    419423int nocaseCmp(const std::string& s1, const std::string& s2, unsigned int len)
Note: See TracChangeset for help on using the changeset viewer.