Esempio n. 1
0
 bool check_depth(const char* type)
 {
     if (depth <= 0) {
         the_error.reset(new error::TypeMismatchError("object", type));
         return false;
     }
     return true;
 }
Esempio n. 2
0
    void PrepareForReuse()
    {
        depth = 0;
        state = -1;
        the_error.reset();
        reset_flags();
        handler_0.PrepareForReuse();

    }
Esempio n. 3
0
    void set_missing_required(const char* name)
    {
        if (the_error.empty() || the_error->type() != error::MISSING_REQUIRED)
            the_error.reset(new error::RequiredFieldMissingError());

        std::vector<std::string>& missing =
            static_cast<error::RequiredFieldMissingError*>(the_error.get())->missing_members();

        missing.push_back(name);
    }
Esempio n. 4
0
 bool set_type_mismatch(const char* actual_type)
 {
     the_error.reset(new error::TypeMismatchError(type_name(), actual_type));
     return false;
 }
Esempio n. 5
0
 bool set_out_of_range(const char* actual_type)
 {
     the_error.reset(new error::NumberOutOfRangeError(type_name(), actual_type));
     return false;
 }
Esempio n. 6
0
 void PrepareForReuse()
 {
     the_error.reset();
 }
Esempio n. 7
0
 bool checked_event_forwarding(bool success)
 {
     if (!success)
         the_error.reset(new error::ObjectMemberError(current_member_name()));
     return success;
 }