From: Ramon F Herrera on

The one facility I miss from Perl is 'split()'. What should I use to
implement it in C++?

My choices would be:

- string operations such as .find() and .substr() and from there RYO.

- something based on Boost::regex

I need to break down a file path into its constituent subdirectories,
and similar operations.

Any other suggestions, comments?

TIA,

-Ramon

RYO: Roll Your Own

From: Ronald Landheer-Cieslak on
Ramon F Herrera wrote:
> The one facility I miss from Perl is 'split()'. What should I use to
> implement it in C++?
>
> My choices would be:
>
> - string operations such as .find() and .substr() and from there RYO.
>
> - something based on Boost::regex
>
> I need to break down a file path into its constituent subdirectories,
> and similar operations.
>
> Any other suggestions, comments?
http://www.boost.org/doc/libs/1_41_0/libs/tokenizer/index.html

HTH

rlc

--
Ronald Landheer-Cieslak
Software Development Professional
http://landheer-cieslak.com
http://vlinder.ca

--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Jerry Coffin on
In article <27a01af4-cda4-4221-909c-a79ee34a3096
@p8g2000yqb.googlegroups.com>, ramon(a)conexus.net says...
>
> The one facility I miss from Perl is 'split()'. What should I use to
> implement it in C++?
>
> My choices would be:
>
> - string operations such as .find() and .substr() and from there RYO.
>
> - something based on Boost::regex
>
> I need to break down a file path into its constituent subdirectories,
> and similar operations.

Boost has a tokenizer and, specifically for file paths, there's also
the Boost filesystem library.

--
Later,
Jerry.
From: gaus on
On Jan 24, 8:56 pm, Jerry Coffin <jerryvcof...(a)yahoo.com> wrote:
> In article <27a01af4-cda4-4221-909c-a79ee34a3096
> @p8g2000yqb.googlegroups.com>, ra...(a)conexus.net says...
>
>
>
> > The one facility I miss from Perl is 'split()'. What should I use to
> > implement it in C++?
>
> > My choices would be:
>
> >  - string operations such as .find() and .substr() and from there RYO..
>
> >  - something based on Boost::regex
>
> > I need to break down a file path into its constituent subdirectories,
> > and similar operations.
>
> Boost has a tokenizer and, specifically for file paths, there's also
> the Boost filesystem library.
>
> --
>     Later,
>     Jerry.

Yes I think u can use c api "SpiltPath"
it will used to seperate file paths
From: Rui Maciel on
Ramon F Herrera wrote:

> The one facility I miss from Perl is 'split()'. What should I use to
> implement it in C++?

Does re2c suit your needs?


Rui Maciel