FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
August 01, 2003

Generalized String Manipulation: Access Shims and Type Tunneling

(Page 2 of 20)
Listing 1: Tokenize PATH into a listbox

Listing 1: Tokenize PATH into a listbox

typedef std::string                           string_t;
typedef stlsoft::string_tokenizer < string_t
                                  , char
                                  , ...>      tokenizer_t;

// Tokenize the PATH contents, with ; as the separator
tokenizer_t tokens(winstl::environment_variable<char>("PATH"), ';');
HWND        hwndList = ::GetDlgItem(. . .);

// Iterate sequence, place each element in list control
tokenizer_t::const_iterator begin = tokens.begin();
tokenizer_t::const_iterator end   = tokens.end();

for(; begin != end; ++begin)
{
  // Add the item to the result ...
  const string_t  &s(*begin);

  ListBox_AddString(hwndList, s.c_str());
}

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 Next Page
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK