manpagez: man pages & more
info cln
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.1 Strings

The class

                      String
                     cl_string
                   <cln/string.h>

implements immutable strings.

Strings are constructed through the following constructors:

cl_string (const char * s)

Returns an immutable copy of the (zero-terminated) C string s.

cl_string (const char * ptr, unsigned long len)

Returns an immutable copy of the len characters at ptr[0], …, ptr[len-1]. NUL characters are allowed.

The following functions are available on strings:

operator =

Assignment from cl_string and const char *.

s.size()
strlen(s)

Returns the length of the string s.

s[i]

Returns the ith character of the string s. i must be in the range 0 <= i < s.size().

bool equal (const cl_string& s1, const cl_string& s2)

Compares two strings for equality. One of the arguments may also be a plain const char *.


This document was generated on August 27, 2013 using texi2html 5.0.

© manpagez.com 2000-2017
Individual documents may contain additional copyright information.