Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
dart::Int64Parameter Class Reference
Inheritance diagram for dart::Int64Parameter:
dart::MethodParameter

Public Member Functions

 Int64Parameter (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 Validate (const char *value) const
 
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 int64_t Parse (const char *value, int64_t default_value=-1)
 

Detailed Description

Definition at line 750 of file service.cc.

Constructor & Destructor Documentation

◆ Int64Parameter()

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

Definition at line 752 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 int64_t dart::Int64Parameter::Parse ( const char *  value,
int64_t  default_value = -1 
)
inlinestatic

Definition at line 767 of file service.cc.

767 {
768 if ((value == nullptr) || (*value == '\0')) {
769 return default_value;
770 }
771 char* end_ptr = nullptr;
772 int64_t result = strtoll(value, &end_ptr, 10);
773 ASSERT(*end_ptr == '\0'); // Parsed full string
774 return result;
775 }
#define ASSERT(E)
uint8_t value
GAsyncResult * result

◆ Validate()

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

Reimplemented from dart::MethodParameter.

Definition at line 755 of file service.cc.

755 {
756 if (value == nullptr) {
757 return false;
758 }
759 for (const char* cp = value; *cp != '\0'; cp++) {
760 if ((*cp < '0' || *cp > '9') && (*cp != '-')) {
761 return false;
762 }
763 }
764 return true;
765 }

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