mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-30 13:47:15 +01:00
Change FilterKeyHandler from struct to class
Also disable copy constructor/assignment operator
This commit is contained in:
@@ -15,7 +15,8 @@ using namespace rapidjson;
|
||||
|
||||
// This handler forwards event into an output handler, with filtering the descendent events of specified key.
|
||||
template <typename OutputHandler>
|
||||
struct FilterKeyHandler {
|
||||
class FilterKeyHandler {
|
||||
public:
|
||||
typedef char Ch;
|
||||
|
||||
FilterKeyHandler(OutputHandler& outputHandler, const Ch* keyString, SizeType keyLength) :
|
||||
@@ -87,12 +88,16 @@ struct FilterKeyHandler {
|
||||
return outputHandler_.EndArray(elementCount) && EndValue();
|
||||
}
|
||||
|
||||
private:
|
||||
FilterKeyHandler(const FilterKeyHandler&);
|
||||
FilterKeyHandler& operator=(const FilterKeyHandler&);
|
||||
|
||||
bool EndValue() {
|
||||
if (filterValueDepth_ == 1) // Just at the end of value after filtered key
|
||||
filterValueDepth_ = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
OutputHandler& outputHandler_;
|
||||
const char* keyString_;
|
||||
const SizeType keyLength_;
|
||||
|
||||
Reference in New Issue
Block a user