This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Embed: (wiki syntax)

« Back to documentation index

UrlReader Class Reference

UrlReader Class Reference

This class is NULL terminated URL text reader. More...

#include <UrlReader.h>

Public Member Functions

 UrlReader (const char *i_ref_url=NULL)
 The constructor This function creates reader interface for null terminated text.
void setUrl (const char *i_ref_url)
 This function sets new text.
bool hasQueryKey (const char *key)
 This function confirms URL has a query key.
bool getQueryStr (const char *key, const char *&o_ref_val, int &o_val_len)
 This function gets a query key value.
bool getQueryUInt (const char *key, unsigned int &v)
 This function gets a converted query key value in unsigned integer.
bool getQueryInt (const char *key, int &v)
 This function gets a converted query key value in integer.
bool isQueryEqualStr (const char *key, const char *v)
 This function gets a query key value and check it is equal.
bool isQueryEqualUInt (const char *key, unsigned int v)
 This function gets a query key value and check it is equal.
bool isQueryEqualInt (const char *key, int v)
 This function gets a query key value and check it is equal.
bool getPath (const char *&path, int &l)
 This function gets path part pointer and length from text.
bool isPathEqual (const char *path)
 This function checks whether a path section in URL string is equal.

Detailed Description

This class is NULL terminated URL text reader.

(Currentry, The class can read only absolute URL.)

Definition at line 9 of file UrlReader.h.


Constructor & Destructor Documentation

UrlReader ( const char *  i_ref_url = NULL )

The constructor This function creates reader interface for null terminated text.

Parameters:
i_ref_strURL text for read. This is referenced pointer. Must hold it until an instance is closed. If omited this, Should call setUrl function before call other functions.

Definition at line 7 of file UrlReader.cpp.


Member Function Documentation

bool getPath ( const char *&  path,
int &  l 
)

This function gets path part pointer and length from text.

Parameters:
i_pathaddress of variable which store a pointer to path part.
i_llength of path part.
Returns:
true if got. otherwise false

Definition at line 11 of file UrlReader.cpp.

bool getQueryInt ( const char *  key,
int &  v 
)

This function gets a converted query key value in integer.

Parameters:
keya query key name.
vaddress of variable which store a pointer to key value.
Returns:
true if got value. otherwise false.

Definition at line 54 of file UrlReader.cpp.

bool getQueryStr ( const char *  key,
const char *&  o_ref_val,
int &  o_val_len 
)

This function gets a query key value.

Parameters:
keya query key name.
o_ref_valueaddress of variable which store a pointer to key value. It is part of URL which is not terminated by '\0'.
o_val_lenlength of value text.
Returns:
true if got value. otherwise false.

Definition at line 46 of file UrlReader.cpp.

bool getQueryUInt ( const char *  key,
unsigned int &  v 
)

This function gets a converted query key value in unsigned integer.

Parameters:
keya query key name.
vaddress of variable which store a pointer to key value.
Returns:
true if got value. otherwise false.

Definition at line 50 of file UrlReader.cpp.

bool hasQueryKey ( const char *  key )

This function confirms URL has a query key.

Parameters:
keya query key name in text.
Returns:
TRUE if text has key name, otherwise FALSE.
Parameters:
keykey name.

Definition at line 42 of file UrlReader.cpp.

bool isPathEqual ( const char *  path )

This function checks whether a path section in URL string is equal.

Definition at line 15 of file UrlReader.cpp.

bool isQueryEqualInt ( const char *  key,
int  v 
)

This function gets a query key value and check it is equal.

Parameters:
keykey name.
vstring to check
Returns:
true if got value that is same as v. otherwise false.

Definition at line 75 of file UrlReader.cpp.

bool isQueryEqualStr ( const char *  key,
const char *  v 
)

This function gets a query key value and check it is equal.

Parameters:
keykey name.
vstring to check
Returns:
true if got value that is same as v. otherwise false.

Definition at line 58 of file UrlReader.cpp.

bool isQueryEqualUInt ( const char *  key,
unsigned int  v 
)

This function gets a query key value and check it is equal.

Parameters:
keykey name.
vstring to check
Returns:
true if got value that is same as v. otherwise false.

Definition at line 67 of file UrlReader.cpp.

void setUrl ( const char *  i_ref_url )

This function sets new text.

Parameters:
i_ref_strURL text for read. This is referenced pointer. Must hold it until an instance is closed.

Definition at line 29 of file UrlReader.cpp.