changed Awk and Sed to inherit Uncopyable

This commit is contained in:
hyung-hwan 2015-03-10 09:00:21 +00:00
parent 49d57e3155
commit 9a3ca2e3c1
5 changed files with 11 additions and 17 deletions

View File

@ -57,7 +57,7 @@ public:
static qse_size_t getHashCode (const qse_char_t* str) static qse_size_t getHashCode (const qse_char_t* str)
{ {
return getHashCode (0, str); return this->getHashCode (0, str);
} }
static qse_size_t getHashCode (qse_size_t init, const void* data, qse_size_t size) static qse_size_t getHashCode (qse_size_t init, const void* data, qse_size_t size)
@ -88,7 +88,7 @@ public:
static qse_size_t getHashCode (const void* data, qse_size_t size) static qse_size_t getHashCode (const void* data, qse_size_t size)
{ {
return getHashCode (0, data, size); return this->getHashCode (0, data, size);
} }
}; };

View File

@ -153,9 +153,9 @@ public:
protected: protected:
qse_size_t* _ref; qse_size_t* _ref;
T* _ptr; T* _ptr;
void* _darg; void* _darg;
DELETER deleter; DELETER deleter;
}; };
///////////////////////////////// /////////////////////////////////

View File

@ -30,6 +30,7 @@
#include <qse/awk/awk.h> #include <qse/awk/awk.h>
#include <qse/cmn/htb.h> #include <qse/cmn/htb.h>
#include <qse/cmn/chr.h> #include <qse/cmn/chr.h>
#include <qse/Uncopyable.hpp>
#include <qse/Types.hpp> #include <qse/Types.hpp>
#include <qse/cmn/Mmged.hpp> #include <qse/cmn/Mmged.hpp>
#include <stdarg.h> #include <stdarg.h>
@ -45,7 +46,7 @@ QSE_BEGIN_NAMESPACE(QSE)
/// The Awk class implements an AWK interpreter by wrapping around /// The Awk class implements an AWK interpreter by wrapping around
/// #qse_awk_t and #qse_awk_rtx_t. /// #qse_awk_t and #qse_awk_rtx_t.
/// ///
class QSE_EXPORT Awk: public Types, public Mmged class QSE_EXPORT Awk: public Uncopyable, public Types, public Mmged
{ {
public: public:
typedef qse_htb_t htb_t; typedef qse_htb_t htb_t;
@ -1363,10 +1364,6 @@ private:
int dispatch_function (Run* run, const fnc_info_t* fi); int dispatch_function (Run* run, const fnc_info_t* fi);
static const char_t* xerrstr (const awk_t* a, errnum_t num); static const char_t* xerrstr (const awk_t* a, errnum_t num);
private:
Awk (const Awk&);
Awk& operator= (const Awk&);
}; };
///////////////////////////////// /////////////////////////////////

View File

@ -27,6 +27,7 @@
#ifndef _QSE_SED_SED_HPP_ #ifndef _QSE_SED_SED_HPP_
#define _QSE_SED_SED_HPP_ #define _QSE_SED_SED_HPP_
#include <qse/Uncopyable.hpp>
#include <qse/Types.hpp> #include <qse/Types.hpp>
#include <qse/cmn/Mmged.hpp> #include <qse/cmn/Mmged.hpp>
#include <qse/sed/sed.h> #include <qse/sed/sed.h>
@ -46,12 +47,12 @@ QSE_BEGIN_NAMESPACE(QSE)
/// ///
/// The Sed class implements a stream editor by wrapping around #qse_sed_t. /// The Sed class implements a stream editor by wrapping around #qse_sed_t.
/// ///
class QSE_EXPORT Sed: public Types, public Mmged class QSE_EXPORT Sed: public Uncopyable, public Types, public Mmged
{ {
public: public:
/// The sed_t type redefines a stream editor type /// The sed_t type redefines a stream editor type
typedef qse_sed_t sed_t; typedef qse_sed_t sed_t;
/// The loc_t type redefines the location type /// The loc_t type redefines the location type
typedef qse_sed_loc_t loc_t; typedef qse_sed_loc_t loc_t;
/// The errnum_t type redefines an error number type /// The errnum_t type redefines an error number type
typedef qse_sed_errnum_t errnum_t; typedef qse_sed_errnum_t errnum_t;
@ -312,10 +313,6 @@ private:
static ssize_t xout ( static ssize_t xout (
sed_t* s, io_cmd_t cmd, io_arg_t* arg, char_t* dat, size_t len); sed_t* s, io_cmd_t cmd, io_arg_t* arg, char_t* dat, size_t len);
static const char_t* xerrstr (const sed_t* s, errnum_t num); static const char_t* xerrstr (const sed_t* s, errnum_t num);
private:
Sed (const Sed&);
Sed& operator= (const Sed&);
}; };
///////////////////////////////// /////////////////////////////////

View File

@ -1383,7 +1383,7 @@ int Awk::dispatch_function (Run* run, const fnc_info_t* fi)
} }
FunctionHandler handler; FunctionHandler handler;
handler = *(FunctionHandler*)QSE_HTB_VPTR(pair); handler = *(FunctionHandler*)QSE_HTB_VPTR(pair);
size_t i, nargs = qse_awk_rtx_getnargs(run->rtx); size_t i, nargs = qse_awk_rtx_getnargs(run->rtx);