Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
dart::UIntParameter Class Reference
Inheritance diagram for dart::UIntParameter:
dart::MethodParameter

Public Member Functions

 UIntParameter (const char *name, bool required)
 
virtual bool Validate (const char *value) const
 
- Public Member Functions inherited from dart::MethodParameter
 MethodParameter (const char *name, bool required)
 
virtual ~MethodParameter ()
 
virtual bool ValidateObject (const Object &value) const
 
const char * name () const
 
bool required () const
 
virtual void PrintError (const char *name, const char *value, JSONStream *js) const
 
virtual void PrintErrorObject (const char *name, const Object &value, JSONStream *js) const
 

Static Public Member Functions

static uintptr_t Parse (const char *value)
 

Detailed Description

Definition at line 722 of file service.cc.

Constructor & Destructor Documentation

◆ UIntParameter()

dart::UIntParameter::UIntParameter ( const char *  name,
bool  required 
)
inline

Definition at line 724 of file service.cc.

const char * name() const
Definition service.cc:147
MethodParameter(const char *name, bool required)
Definition service.cc:138
bool required() const
Definition service.cc:149

Member Function Documentation

◆ Parse()

static uintptr_t dart::UIntParameter::Parse ( const char *  value)
inlinestatic

Definition at line 739 of file service.cc.

739 {
740 if (value == nullptr) {
741 return -1;
742 }
743 char* end_ptr = nullptr;
744 uintptr_t result = strtoul(value, &end_ptr, 10);
745 ASSERT(*end_ptr == '\0'); // Parsed full string
746 return result;
747 }
#define ASSERT(E)
GAsyncResult * result

◆ Validate()

virtual bool dart::UIntParameter::Validate ( const char *  value) const
inlinevirtual

Reimplemented from dart::MethodParameter.

Definition at line 727 of file service.cc.

727 {
728 if (value == nullptr) {
729 return false;
730 }
731 for (const char* cp = value; *cp != '\0'; cp++) {
732 if (*cp < '0' || *cp > '9') {
733 return false;
734 }
735 }
736 return true;
737 }

The documentation for this class was generated from the following file: