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

Public Member Functions

 UInt64Parameter (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 uint64_t Parse (const char *value, uint64_t default_value=0)
 

Detailed Description

Definition at line 778 of file service.cc.

Constructor & Destructor Documentation

◆ UInt64Parameter()

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

Definition at line 780 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 uint64_t dart::UInt64Parameter::Parse ( const char *  value,
uint64_t  default_value = 0 
)
inlinestatic

Definition at line 795 of file service.cc.

795 {
796 if ((value == nullptr) || (*value == '\0')) {
797 return default_value;
798 }
799 char* end_ptr = nullptr;
800 uint64_t result = strtoull(value, &end_ptr, 10);
801 ASSERT(*end_ptr == '\0'); // Parsed full string
802 return result;
803 }
#define ASSERT(E)
GAsyncResult * result

◆ Validate()

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

Reimplemented from dart::MethodParameter.

Definition at line 783 of file service.cc.

783 {
784 if (value == nullptr) {
785 return false;
786 }
787 for (const char* cp = value; *cp != '\0'; cp++) {
788 if ((*cp < '0' || *cp > '9') && (*cp != '-')) {
789 return false;
790 }
791 }
792 return true;
793 }

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