Changeset 1088


Ignore:
Timestamp:
2000-04-14T14:50:12+12:00 (24 years ago)
Author:
sjboddie
Message:

added text_t versions of joinchar to work with sets and lists

Location:
trunk/gsdl/lib
Files:
2 edited

Legend:

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

    r1076 r1088  
    2828/*
    2929   $Log$
     30   Revision 1.18  2000/04/14 02:50:12  sjboddie
     31   added text_t versions of joinchar to work with sets and lists
     32
    3033   Revision 1.17  2000/04/06 19:58:03  cs025
    3134   Correcting a correction - reinstated all lib files due to silly
     
    434437    {
    435438      if (!first) outtext.push_back (c);
     439      first = false;
     440      outtext += *here;
     441      here++;
     442    }
     443}
     444
     445void joinchar (const text_tlist &inlist, text_t c, text_t &outtext)
     446{
     447  outtext.clear ();
     448
     449  text_tlist::const_iterator here = inlist.begin ();
     450  text_tlist::const_iterator end = inlist.end ();
     451  bool first = true;
     452  while (here != end)
     453    {
     454      if (!first) outtext += c;
     455      first = false;
     456      outtext += *here;
     457      here++;
     458    }
     459}
     460
     461void joinchar (const text_tset &inlist, text_t c, text_t &outtext)
     462{
     463  outtext.clear ();
     464
     465  text_tset::const_iterator here = inlist.begin ();
     466  text_tset::const_iterator end = inlist.end ();
     467  bool first = true;
     468  while (here != end)
     469    {
     470      if (!first) outtext += c;
    436471      first = false;
    437472      outtext += *here;
  • trunk/gsdl/lib/text_t.h

    r1076 r1088  
    238238void joinchar (const text_tlist &inlist, unsigned short c, text_t &outtext);
    239239void joinchar (const text_tarray &inlist, unsigned short c, text_t &outtext);
     240void joinchar (const text_tset &inlist, text_t c, text_t &outtext);
     241void joinchar (const text_tlist &inlist, text_t c, text_t &outtext);
    240242void joinchar (const text_tarray &inlist, text_t c, text_t &outtext);
    241243
Note: See TracChangeset for help on using the changeset viewer.