StrOps::Indent( StrBuf &, const StrPtr & )

Make a copy of a string, with each line indented.

Virtual?

No

 

Class

StrOps

 

Arguments

StrBuf &o

the output string

 

StrPtr &s

the input string

Returns

void

 

Notes

This function reads the input string s and copies it to the output string o, with each line indented with a single tab.

Example

StrBuf s = StrBuf();
s.Set( "abc\ndef\nghi\n" );

StrBuf o = StrBuf();
StrOps::Indent( o, s );

printf( "Before:\n%s", s.Text() );
printf( "After:\n%s", o.Text() );

Executing the preceding code produces the following output:

Before:
abc
def
ghi
After:
        abc
        def
        ghi