]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/regex.h
Add move semantics to Variant
[libs/core.git] / source / strings / regex.h
index 67925023e544e76cd3f594addd0693d2b860d2c4..42c1e01a6951a4c3229c4d5b9eadad18bc119d0d 100644 (file)
@@ -3,15 +3,15 @@
 
 #include <stdexcept>
 #include <string>
+#include <msp/core/mspcore_api.h>
 #include "regmatch.h"
 
 namespace Msp {
 
-class bad_regex: public std::logic_error
+class MSPCORE_API bad_regex: public std::logic_error
 {
 public:
        bad_regex(const std::string &, const std::string &, const std::string::const_iterator &);
-       virtual ~bad_regex() throw() { }
 
 private:
        std::string make_where(const std::string &, const std::string::const_iterator &);
@@ -70,7 +70,7 @@ a bitmask.
 
 The MATCH_ANY instruction consumes the input character and always succeeds.
 */
-class Regex
+class MSPCORE_API Regex
 {
 private:
        typedef std::basic_string<unsigned char> Code;
@@ -103,11 +103,11 @@ private:
        struct RunContext
        {
                Code::const_iterator citer;
-               RegMatch::GroupArray groups;
+               std::vector<RegMatch::Group> groups;
        };
 
        Code code;
-       unsigned n_groups;
+       unsigned n_groups = 0;
 
 public:
        /** Constructs a new Regex object from a string representation. */
@@ -128,7 +128,7 @@ public:
        RegMatch match(const std::string &str) const;
 
 private:
-       bool run(const std::string &, const std::string::const_iterator &, RegMatch::GroupArray &) const;
+       bool run(const std::string &, const std::string::const_iterator &, std::vector<RegMatch::Group> &) const;
        bool group_compare(const RegMatch::Group &, const RegMatch::Group &) const;
 
 public: