COIN-OR::LEMON - Graph Library

Changeset 197:5893bacaa720 in lemon-1.2


Ignore:
Timestamp:
07/08/08 14:57:44 (16 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Set inline functions in header files (ticket #115)

Location:
lemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/lgf_reader.h

    r192 r197  
    196196    };
    197197
    198     bool isWhiteSpace(char c) {
     198    inline bool isWhiteSpace(char c) {
    199199      return c == ' ' || c == '\t' || c == '\v' ||
    200200        c == '\n' || c == '\r' || c == '\f';
    201201    }
    202202   
    203     bool isOct(char c) {
     203    inline bool isOct(char c) {
    204204      return '0' <= c && c <='7';
    205205    }
    206206   
    207     int valueOct(char c) {
     207    inline int valueOct(char c) {
    208208      LEMON_ASSERT(isOct(c), "The character is not octal.");
    209209      return c - '0';
    210210    }
    211211
    212     bool isHex(char c) {
     212    inline bool isHex(char c) {
    213213      return ('0' <= c && c <= '9') ||
    214214        ('a' <= c && c <= 'z') ||
     
    216216    }
    217217   
    218     int valueHex(char c) {
     218    inline int valueHex(char c) {
    219219      LEMON_ASSERT(isHex(c), "The character is not hexadecimal.");
    220220      if ('0' <= c && c <= '9') return c - '0';
     
    223223    }
    224224
    225     bool isIdentifierFirstChar(char c) {
     225    inline bool isIdentifierFirstChar(char c) {
    226226      return ('a' <= c && c <= 'z') ||
    227227        ('A' <= c && c <= 'Z') || c == '_';
    228228    }
    229229
    230     bool isIdentifierChar(char c) {
     230    inline bool isIdentifierChar(char c) {
    231231      return isIdentifierFirstChar(c) ||
    232232        ('0' <= c && c <= '9');
    233233    }
    234234
    235     char readEscape(std::istream& is) {
     235    inline char readEscape(std::istream& is) {
    236236      char c;
    237237      if (!is.get(c))
     
    285285    }
    286286   
    287     std::istream& readToken(std::istream& is, std::string& str) {
     287    inline std::istream& readToken(std::istream& is, std::string& str) {
    288288      std::ostringstream os;
    289289
  • lemon/lgf_writer.h

    r192 r197  
    226226    };
    227227
    228     bool isWhiteSpace(char c) {
     228    inline bool isWhiteSpace(char c) {
    229229      return c == ' ' || c == '\t' || c == '\v' ||
    230230        c == '\n' || c == '\r' || c == '\f';
    231231    }
    232232
    233     bool isEscaped(char c) {
     233    inline bool isEscaped(char c) {
    234234      return c == '\\' || c == '\"' || c == '\'' ||
    235235        c == '\a' || c == '\b';
    236236    }
    237237
    238     static void writeEscape(std::ostream& os, char c) {
     238    inline static void writeEscape(std::ostream& os, char c) {
    239239      switch (c) {
    240240      case '\\':
     
    277277    }
    278278
    279     bool requireEscape(const std::string& str) {
     279    inline bool requireEscape(const std::string& str) {
    280280      if (str.empty() || str[0] == '@') return true;
    281281      std::istringstream is(str);
     
    289289    }
    290290   
    291     std::ostream& writeToken(std::ostream& os, const std::string& str) {
     291    inline std::ostream& writeToken(std::ostream& os, const std::string& str) {
    292292
    293293      if (requireEscape(str)) {
Note: See TracChangeset for help on using the changeset viewer.