SOL9 Sample: StringBufferT

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * StringBufferT.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL9

// 2009/10/22

#include <sol/StringBufferT.h>


void _tmain(int argc, TCHAR** argv)

{
  _tsetlocale(LC_ALL, _T(""));

  StringBufferT<char> cbuffer;
  StringBufferT<wchar_t> wbuffer;
 
  cbuffer.append("Hello");
  cbuffer.append(" World");
  cbuffer.append(' ');
  cbuffer.append(2009);
  cbuffer.append(" Goodbye");
  cbuffer.append(21.0/4.0);


  printf("StringBufferT<char> %s\n", (const char*)cbuffer);
  printf("find %s\n", cbuffer.find("Wor"));

  wbuffer.append(L"Hello");
  wbuffer.append(L" World");
  wbuffer.append(L' ');
  wbuffer.append(2009);
  wbuffer.append(L' ');
  wbuffer.append(10.0/3.0);


  wbuffer.append(L" Goodbye");

  printf("StringBufferT<wchar_t> %S\n", (const wchar_t*)wbuffer);

  printf("find %S\n", wbuffer.find(L"Good"));


  StringT<char> s("This is a char string");
  
  printf("1 %s\n", (const char*)s);

  StringT<wchar_t> w(L"This is a wchar_t string");

  printf("2 %S\n", (const wchar_t*)w);

  cbuffer.append(s);
  
  printf("2 StringBufferT<char> %s\n", (const char*)cbuffer);
  
  wbuffer.append(w);

  printf("2 StringBufferT<wchar_t> %S\n", (const wchar_t*)wbuffer);


  StringT<char> c2;
  cbuffer.getString(c2);
  printf("3 StringBufferT<char> %s\n", (const char*)c2);

  StringT<wchar_t> w2;
  wbuffer.getString(w2);
  printf("3 StringBufferT<wchar_t> %S\n", (const wchar_t*)w2);
}

Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.