#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 &);
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;
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. */
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: