Sha256: c692fdeece058759f7dd07f6887120fde4cfca5c3af972b8b3cd55711d5835e8

Contents?: true

Size: 1.08 KB

Versions: 27

Compression:

Stored size: 1.08 KB

Contents

// -*- c++ -*-
#pragma once
#ifndef __XOT_STRING_H__
#define __XOT_STRING_H__


#include <stdarg.h>
#include <string>


#define XOT_STRINGF(format, result) \
	Xot::String result; \
	do \
	{ \
		if (format) \
		{ \
			va_list args; \
			va_start(args, format); \
			result = Xot::stringf(format, args); \
			va_end(args); \
		} \
	} \
	while (false)


namespace Xot
{


	class String : public std::string
	{

		typedef std::string Super;

		public:

			String ();

			String (const char* str);

			template <typename ITERATOR>
			String (ITERATOR begin, ITERATOR end) : Super(begin, end) {}

			String upcase () const;

			String downcase () const;

			String strip () const;

			operator const char* () const;

			friend String operator + (const String& lhs, const String& rhs);

			friend String operator + (const String& lhs, const char*   rhs);

			friend String operator + (const char*   lhs, const String& rhs);

	};// String


	String stringf (const char* format, ...);

	String stringf (const char* format, va_list args);

	template <typename T> String to_s (const T& val);


}// Xot


#endif//EOH

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
xot-0.1.41 include/xot/string.h
xot-0.1.40 include/xot/string.h
xot-0.1.39 include/xot/string.h
xot-0.1.38 include/xot/string.h
xot-0.1.37 include/xot/string.h
xot-0.1.36 include/xot/string.h
xot-0.1.35 include/xot/string.h
xot-0.1.34 include/xot/string.h
xot-0.1.33 include/xot/string.h
xot-0.1.32 include/xot/string.h
xot-0.1.31 include/xot/string.h
xot-0.1.30 include/xot/string.h
xot-0.1.29 include/xot/string.h
xot-0.1.28 include/xot/string.h
xot-0.1.27 include/xot/string.h
xot-0.1.26 include/xot/string.h
xot-0.1.25 include/xot/string.h
xot-0.1.24 include/xot/string.h
xot-0.1.23 include/xot/string.h
xot-0.1.22 include/xot/string.h