00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef INCLUDE_MATLABOPTION
00010 #define INCLUDE_MATLABOPTION
00011
00012 #include "mex.h"
00013 #include <string>
00014
00015
00016
00017 class MatlabOption {
00018 public:
00019
00020
00021
00022
00023 MatlabOption (const mxArray* ptr);
00024
00025
00026 bool isString() const { return s; };
00027
00028
00029 operator const char* () const { return s->c_str(); };
00030 operator const std::string& () const { return *s; };
00031 operator double () const { return x; };
00032 operator int () const { return (int) x; };
00033
00034
00035 ~MatlabOption();
00036
00037 protected:
00038 std::string* s;
00039 double x;
00040 };
00041
00042 #endif