SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SGString.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012 Fernando José Iglesias García
8  * Written (W) 2010,2012 Soeren Sonnenburg
9  * Written (W) 2012 Jacob Walker
10  * Copyright (C) 2010 Berlin Institute of Technology
11  * Copyright (C) 2012 Soeren Sonnenburg
12  */
13 #ifndef __SGSTRING_H__
14 #define __SGSTRING_H__
15 
16 #include <shogun/lib/config.h>
17 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
21 
22 template<class T> class SGVector;
23 class CFile;
24 
26 template<class T> class SGString
27 {
28 public:
30  SGString();
31 
33  SGString(T* s, index_t l, bool free_s=false);
34 
36  SGString(SGVector<T> v);
37 
39  SGString(index_t len, bool free_s=false);
40 
42  SGString(const SGString &orig);
43 
45  bool operator==(const SGString & other) const;
46 
48  void free_string();
49 
51  void destroy_string();
52 
58  inline SGString<T> get()
59  {
60  return *this;
61  }
62 
67  void load(CFile* loader);
68 
73  void save(CFile* saver);
74 
75 public:
77  T* string;
81  bool do_free;
82 };
83 }
84 #endif // __SGSTRING_H__
void destroy_string()
Definition: SGString.cpp:59
int32_t index_t
Definition: common.h:62
void free_string()
Definition: SGString.cpp:48
shogun string
void save(CFile *saver)
Definition: SGString.cpp:76
void load(CFile *loader)
Definition: SGString.cpp:65
A File access base class.
Definition: File.h:34
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
bool operator==(const SGString &other) const
Definition: SGString.cpp:33
index_t slen
Definition: SGString.h:79

SHOGUN Machine Learning Toolbox - Documentation