summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Glover <glover.john@gmail.com>2011-08-19 16:18:58 +0100
committerJohn Glover <glover.john@gmail.com>2011-08-19 16:18:58 +0100
commit43c2d5723b392b385837a1cf90e75f88abc3d5d6 (patch)
tree4224b3d655a67daf6ee04571ba3f687bad1b5b58
parent855b4bac775617800f88de330c7eaf64c7678063 (diff)
downloadsimpl-43c2d5723b392b385837a1cf90e75f88abc3d5d6.tar.gz
simpl-43c2d5723b392b385837a1cf90e75f88abc3d5d6.tar.bz2
simpl-43c2d5723b392b385837a1cf90e75f88abc3d5d6.zip
Use std::string instead of char*
-rw-r--r--simpl/common.i1
-rw-r--r--src/simpl/base.cpp2
-rw-r--r--src/simpl/base.h5
3 files changed, 6 insertions, 2 deletions
diff --git a/simpl/common.i b/simpl/common.i
index 12cef9d..c45bab8 100644
--- a/simpl/common.i
+++ b/simpl/common.i
@@ -1,4 +1,5 @@
%include exception.i
+%include std_string.i
%include "numpy.i"
%exception
diff --git a/src/simpl/base.cpp b/src/simpl/base.cpp
index 4e34dfd..e126433 100644
--- a/src/simpl/base.cpp
+++ b/src/simpl/base.cpp
@@ -40,7 +40,7 @@ Peak::~Peak()
}
// Returns true iff this peak is unmatched in the given direction, and has positive amplitude
-bool Peak::is_free(const char* direction)
+bool Peak::is_free(string direction)
{
if(amplitude <= 0.0)
{
diff --git a/src/simpl/base.h b/src/simpl/base.h
index 88ff0e9..59a969e 100644
--- a/src/simpl/base.h
+++ b/src/simpl/base.h
@@ -20,9 +20,12 @@
*/
#include <vector>
+#include <string>
#include "exceptions.h"
+using namespace std;
+
namespace Simpl
{
@@ -48,7 +51,7 @@ public:
{
return previous_peak == NULL;
};
- bool is_free(const char* direction="forwards");
+ bool is_free(string direction = string("forwards"));
};
typedef std::vector<Peak> Peaks;