hb.web.common

Contains common functionality for the REST and WEB interface generators.

Members

Classes

RestException
class RestException

Respresents a Rest error response

Enums

MethodStyle
enum MethodStyle

Determines the naming convention of an identifier.

NestedNameStyle
enum NestedNameStyle

Speficies how D fields are mapped to form field names

ParamResult
enum ParamResult
Undocumented in source.

Functions

adjustMethodStyle
string adjustMethodStyle(string name, MethodStyle style)

Adjusts the naming convention for a given function name to the specified style.

bodyParam
WebParamAttribute bodyParam(string identifier, string field)

Declare that a parameter will be transmitted to the API through the body.

concatURL
string concatURL(string prefix, string url, bool trailing)
Undocumented in source. Be warned that the author may not have intended to support it.
contentType
ContentTypeAttribute contentType(string data)

Attribute to define the content type for methods.

extractHTTPMethodAndName
auto extractHTTPMethodAndName()

Determines the HTTP method and path for a given function symbol.

headerParam
WebParamAttribute headerParam(string identifier, string field)

Declare that a parameter will be transmitted to the API through the headers.

method
MethodAttribute method(HTTPMethod data)

Attribute to force a specific HTTP method for an interface method.

path
PathAttribute path(string data)

Attibute to force a specific URL path.

queryParam
WebParamAttribute queryParam(string identifier, string field)

Declare that a parameter will be transmitted to the API through the query string.

readFormParamRec
ParamResult readFormParamRec(HTTPServerRequest req, T dst, string fieldname, bool required, NestedNameStyle style, ParamError err)
Undocumented in source. Be warned that the author may not have intended to support it.
setVoid
void setVoid(T dst, U value)
Undocumented in source. Be warned that the author may not have intended to support it.
webConvTo
bool webConvTo(string str, T dst, ParamError err)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

rootPathFromName
PathAttribute rootPathFromName [@property getter]

Convenience alias to generate a name from the interface's name.

Structs

ContentTypeAttribute
struct ContentTypeAttribute

private

MethodAttribute
struct MethodAttribute

private

ParamError
struct ParamError
Undocumented in source.
PathAttribute
struct PathAttribute

private

WebParamAttribute
struct WebParamAttribute

Private struct describing the origin of a parameter (Query, Header, Body).

Templates

isNullable
template isNullable(T)

private

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig, Михаил Страшун