Dash Core  0.12.2.1
P2P Digital Currency
CProposalValidator Class Reference

#include <governance-validators.h>

Public Member Functions

 CProposalValidator (const std::string &strDataHexIn=std::string())
 
void Clear ()
 
void SetHexData (const std::string &strDataHexIn)
 
bool Validate ()
 
bool ValidateJSON ()
 
bool ValidateName ()
 
bool ValidateStartEndEpoch ()
 
bool ValidatePaymentAmount ()
 
bool ValidatePaymentAddress ()
 
bool ValidateURL ()
 
const std::string & GetErrorMessages ()
 

Private Member Functions

void ParseJSONData ()
 
bool GetDataValue (const std::string &strKey, std::string &strValue)
 
bool GetDataValue (const std::string &strKey, int64_t &nValue)
 
bool GetDataValue (const std::string &strKey, double &dValue)
 

Static Private Member Functions

static std::string StripWhitespace (const std::string &strIn)
 
static bool CheckURL (const std::string &strURLIn)
 

Private Attributes

std::string strData
 
UniValue objJSON
 
bool fJSONValid
 
std::string strErrorMessages
 

Detailed Description

Definition at line 12 of file governance-validators.h.

Constructor & Destructor Documentation

◆ CProposalValidator()

CProposalValidator::CProposalValidator ( const std::string &  strDataHexIn = std::string())

Definition at line 12 of file governance-validators.cpp.

Member Function Documentation

◆ CheckURL()

bool CProposalValidator::CheckURL ( const std::string &  strURLIn)
staticprivate

Definition at line 309 of file governance-validators.cpp.

Referenced by ValidateURL().

◆ Clear()

void CProposalValidator::Clear ( )

Definition at line 23 of file governance-validators.cpp.

◆ GetDataValue() [1/3]

bool CProposalValidator::GetDataValue ( const std::string &  strKey,
std::string &  strValue 
)
private

◆ GetDataValue() [2/3]

bool CProposalValidator::GetDataValue ( const std::string &  strKey,
int64_t &  nValue 
)
private

Definition at line 243 of file governance-validators.cpp.

◆ GetDataValue() [3/3]

bool CProposalValidator::GetDataValue ( const std::string &  strKey,
double &  dValue 
)
private

Definition at line 266 of file governance-validators.cpp.

◆ GetErrorMessages()

const std::string& CProposalValidator::GetErrorMessages ( )
inline

Definition at line 34 of file governance-validators.h.

Referenced by gobject().

◆ ParseJSONData()

void CProposalValidator::ParseJSONData ( )
private

Definition at line 203 of file governance-validators.cpp.

Referenced by SetHexData().

◆ SetHexData()

void CProposalValidator::SetHexData ( const std::string &  strDataHexIn)

Definition at line 31 of file governance-validators.cpp.

Referenced by CProposalValidator().

◆ StripWhitespace()

std::string CProposalValidator::StripWhitespace ( const std::string &  strIn)
staticprivate

Definition at line 289 of file governance-validators.cpp.

Referenced by ValidateName(), and ValidateURL().

◆ Validate()

bool CProposalValidator::Validate ( )

Definition at line 38 of file governance-validators.cpp.

Referenced by gobject().

◆ ValidateJSON()

bool CProposalValidator::ValidateJSON ( )

Definition at line 67 of file governance-validators.cpp.

Referenced by Validate().

◆ ValidateName()

bool CProposalValidator::ValidateName ( )

Definition at line 72 of file governance-validators.cpp.

Referenced by Validate().

◆ ValidatePaymentAddress()

bool CProposalValidator::ValidatePaymentAddress ( )

Definition at line 148 of file governance-validators.cpp.

Referenced by Validate().

◆ ValidatePaymentAmount()

bool CProposalValidator::ValidatePaymentAmount ( )

Definition at line 127 of file governance-validators.cpp.

Referenced by Validate().

◆ ValidateStartEndEpoch()

bool CProposalValidator::ValidateStartEndEpoch ( )

Definition at line 104 of file governance-validators.cpp.

Referenced by Validate().

◆ ValidateURL()

bool CProposalValidator::ValidateURL ( )

Definition at line 180 of file governance-validators.cpp.

Referenced by Validate().

Member Data Documentation

◆ fJSONValid

bool CProposalValidator::fJSONValid
private

Definition at line 57 of file governance-validators.h.

Referenced by Clear(), ParseJSONData(), and ValidateJSON().

◆ objJSON

UniValue CProposalValidator::objJSON
private

Definition at line 55 of file governance-validators.h.

Referenced by Clear(), GetDataValue(), and ParseJSONData().

◆ strData

std::string CProposalValidator::strData
private

Definition at line 53 of file governance-validators.h.

Referenced by Clear(), ParseJSONData(), and SetHexData().

◆ strErrorMessages

std::string CProposalValidator::strErrorMessages
private

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