gnuplot_i.hpp File Reference

#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <cstdio>
#include <cstdlib>
#include <list>

Go to the source code of this file.

Classes

class  GnuplotException
 A C++ interface to gnuplot. More...
class  Gnuplot

Functions

template<typename Container >
void stringtok (Container &container, std::string const &in, const char *const delimiters=" \t\n")


Function Documentation

template<typename Container >
void stringtok ( Container &  container,
std::string const &  in,
const char *const   delimiters = " \t\n" 
) [inline]

Definition at line 905 of file gnuplot_i.hpp.

00908 {
00909     const std::string::size_type len = in.length();
00910           std::string::size_type i = 0;
00911 
00912     while ( i < len )
00913     {
00914         // eat leading whitespace
00915         i = in.find_first_not_of (delimiters, i);
00916 
00917         if (i == std::string::npos)
00918             return;   // nothing left but white space
00919 
00920         // find the end of the token
00921         std::string::size_type j = in.find_first_of (delimiters, i);
00922 
00923         // push token
00924         if (j == std::string::npos)
00925         {
00926             container.push_back (in.substr(i));
00927             return;
00928         }
00929         else
00930             container.push_back (in.substr(i, j-i));
00931 
00932         // set up for next loop
00933         i = j + 1;
00934     }
00935 
00936     return;
00937 }


Generated on Wed Sep 16 12:55:07 2009 for gnuplot-cpp by  doxygen 1.5.8