Changeset 15167


Ignore:
Timestamp:
03/27/13 16:22:23 (9 years ago)
Author:
tbretz
Message:
Added Split(), a wrapper around boost::split
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/tools.cc

    r14981 r15167  
    1515
    1616#include <boost/tokenizer.hpp>
     17#include <boost/algorithm/string.hpp>
    1718
    1819using namespace std;
     
    277278}
    278279
     280vector<string> Tools::Split(const string &str, const string &delim)
     281{
     282    vector<string> rc;
     283    boost::split(rc, str, boost::is_any_of(delim));
     284    return rc;
     285}
     286
    279287// --------------------------------------------------------------------------
    280288//
  • trunk/FACT++/src/tools.h

    r14219 r15167  
    44#include <map>
    55#include <string>
     6#include <vector>
    67
    78namespace Tools
     
    1516
    1617    std::map<std::string,std::string> Split(std::string &, bool = false);
     18    std::vector<std::string> Split(const std::string &, const std::string &);
    1719    std::string Uncomment(const std::string &opt);
    1820}
Note: See TracChangeset for help on using the changeset viewer.