Ignore:
Timestamp:
Nov 16, 2012, 2:47:56 AM (10 years ago)
Author:
Peter
Message:

split function that splits on several chars

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/split.cc

    r2434 r2879  
    22
    33/*
    4   Copyright (C) 2010 Peter Johansson
     4  Copyright (C) 2010, 2012 Peter Johansson
    55
    66  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2929namespace utility {
    3030
    31   void split(std::vector<std::string>& vec, const std::string& str, char delim)
     31namespace detail {
     32
     33  /*
     34    implementation of split functions is declared in private namespace
     35    and only available in this file.
     36   */
     37  template<typename T>
     38  void split(std::vector<std::string>& vec, const std::string& str, T delim)
    3239  {
    3340    size_t pos=0;
     
    4047    }
    4148  }
     49} // end of namespace detail
     50
     51
     52  void split(std::vector<std::string>& vec, const std::string& str, char delim)
     53  {
     54    detail::split(vec, str, delim);
     55  }
     56
     57
     58  void split(std::vector<std::string>& vec, const std::string& str,
     59             const std::string& delim)
     60  {
     61    detail::split(vec, str, delim);
     62  }
    4263
    4364}}} // of namespace utility, yat, and theplu
Note: See TracChangeset for help on using the changeset viewer.