Arduino Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
string.hpp
Go to the documentation of this file.
1 // Author: Mario S. Könz <mskoenz@gmx.net>
2 // Date: 23.05.2013 20:57:32 EDT
3 // File: string.hpp
4 
5 /* This program is free software. It comes without any warranty, to
6  * the extent permitted by applicable law. You can redistribute it
7  * and/or modify it under the terms of the Do What The Fuck You Want
8  * To Public License, Version 2, as published by Sam Hocevar. See
9  * http://www.wtfpl.net/ or COPYING for more details. */
10 
11 #ifndef __STRING_HEADER
12 #define __STRING_HEADER
13 
14 #include <string.h>
15 
16 namespace ustd {
17  struct string {
18  string(): ptr(NULL) {
19  }
20  string(char const * arg): ptr(arg) {
21  }
22  string & operator=(char * arg) {
23  ptr = arg;
24  return *this;
25  }
26  operator char const * () const {
27  return ptr;
28  }
29  char const * ptr;
30  };
31 
32 
33  inline bool operator==(string const a, string const b) {
34  return (strcmp(a, b) == 0);
35  }
36 }
37 #endif //__STRING_HEADER
Definition: string.hpp:17
bool operator==(string const a, string const b)
Definition: string.hpp:33
string & operator=(char *arg)
Definition: string.hpp:22
string(char const *arg)
Definition: string.hpp:20
char const * ptr
Definition: string.hpp:29
string()
Definition: string.hpp:18