Changeset 12504


Ignore:
Timestamp:
2006-08-23T17:17:29+12:00 (18 years ago)
Author:
kjdon
Message:

added findlastchar method, and removed cvs log from text_t.cpp

Location:
trunk/gsdl/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/text_t.cpp

    r10140 r12504  
    2626 *********************************************************************/
    2727
    28 /*
    29    $Log$
    30    Revision 1.25  2005/06/16 22:49:44  kjdon
    31    added starts_with and ends_with functions
    32 
    33    Revision 1.24  2005/04/07 04:27:18  kjdon
    34    added some x++ -> ++x changes submitted by Emanuel Dejanu
    35 
    36    Revision 1.23  2004/12/02 22:21:34  kjdon
    37    added some changes made by Emanuel Dejanu (Simple Words)
    38 
    39    Revision 1.22  2004/05/24 03:43:22  mdewsnip
    40    (Human Info) Added const text_t g_EmptyText("") to use instead of plain ol' "".
    41 
    42    Revision 1.21  2001/06/01 02:51:28  sjboddie
    43    Changes to get phind working under windows
    44 
    45    Revision 1.20  2001/01/25 18:26:44  cs025
    46    Included CORBA branch for first time
    47 
    48    Revision 1.15.2.2  2000/04/05 10:19:38  syeates
    49    added automatic conversion to allow text_t's to be <<'ed to ostreams
    50 
    51    Revision 1.15.2.1  2000/04/04 15:02:29  cs025
    52    Corba first commit
    53 
    54    Revision 1.15  1999/10/14 22:52:39  sjboddie
    55    joinchar can join using text_t string now too
    56 
    57    Revision 1.14  1999/09/24 02:30:03  rjmcnab
    58    added function has_unicode_letdig
    59 
    60    Revision 1.13  1999/09/07 04:57:43  sjboddie
    61    added gpl notice
    62 
    63    Revision 1.12  1999/08/31 08:04:41  rjmcnab
    64    Fixed a small but hard to find bug in getcarr
    65 
    66    Revision 1.11  1999/07/01 04:05:09  rjmcnab
    67    Optimised append functions slightly and added a reserve function.
    68 
    69    Revision 1.10  1999/04/26 03:58:03  sjboddie
    70    added is_number function
    71 
    72    Revision 1.9  1999/04/06 22:17:24  rjmcnab
    73    Added splits and joins using text_tset.
    74 
    75    Revision 1.8  1999/02/28 23:14:41  rjmcnab
    76 
    77    Added uc and lc to convert to uppercase and lowercase.
    78 
    79    Revision 1.7  1999/02/21 22:26:39  rjmcnab
    80 
    81    Made getint() a constant function.
    82 
    83    Revision 1.6  1999/02/03 01:13:26  sjboddie
    84 
    85    Got interface to handle subcollections and language subcollections -
    86    committed changes made to some of the collections
    87 
    88    Revision 1.5  1999/01/19 01:38:14  rjmcnab
    89 
    90    Made the source more portable.
    91 
    92    Revision 1.4  1999/01/12 01:51:00  rjmcnab
    93 
    94    Standard header.
    95 
    96    Revision 1.3  1999/01/08 02:33:16  rjmcnab
    97 
    98    Added standard header to source files.
    99 
    100  */
    101 
    10228#include "text_t.h"
    10329
     
    395321    }
    396322  return first;
     323}
     324
     325text_t::iterator findlastchar (text_t::iterator first, text_t::iterator last,
     326               unsigned short c)
     327{
     328  text_t::iterator current = last;
     329  while (current != first) {
     330    if (*current == c) break;
     331    --current;
     332  }
     333  if (current == first) {
     334    if (*current == c) return current;
     335    return last;
     336  }
     337
     338  return current;
    397339}
    398340
  • trunk/gsdl/lib/text_t.h

    r10140 r12504  
    224224text_t::iterator findchar (text_t::iterator first, text_t::iterator last,
    225225               unsigned short c);
    226 
     226text_t::iterator findlastchar (text_t::iterator first, text_t::iterator last,
     227                   unsigned short c);
    227228text_t::iterator findword (text_t::iterator first, text_t::iterator last,
    228229               const text_t &word);
Note: See TracChangeset for help on using the changeset viewer.