Ejemplo n.º 1
0
JsonObject*
SamiCloudSearch::asJsonObject() {
    JsonObject *pJsonObject = new JsonObject();
    pJsonObject->Construct();

    
    JsonString *pQueryKey = new JsonString(L"query");
    pJsonObject->Add(pQueryKey, toJson(getPQuery(), "SamiFilterBody", ""));

    
    JsonString *pSortKey = new JsonString(L"sort");
    pJsonObject->Add(pSortKey, toJson(getPSort(), "String", "array"));

    
    JsonString *pCollectionNameKey = new JsonString(L"collectionName");
    pJsonObject->Add(pCollectionNameKey, toJson(getPCollectionName(), "String", ""));

    
    JsonString *pKeyKey = new JsonString(L"key");
    pJsonObject->Add(pKeyKey, toJson(getPKey(), "String", ""));

    
    JsonString *pSkipKey = new JsonString(L"skip");
    pJsonObject->Add(pSkipKey, toJson(getPSkip(), "Integer", ""));

    
    JsonString *pLimitKey = new JsonString(L"limit");
    pJsonObject->Add(pLimitKey, toJson(getPLimit(), "Integer", ""));

    
    return pJsonObject;
}
Ejemplo n.º 2
0
PortcullisStateAction*  Portcullis::checkInteraction() {
    PortcullisStateAction* gateAction = NULL;
    if ((state == OPEN_STATE || state == CLOSED_STATE) && checkKeyTouch(key)) {
        // Toggle the port state
        state++;
        allowsEntry = true; // Either the gate is now opening and active or now closing but still active
        // If we are in the same room, broadcast the state change
        gateAction = new PortcullisStateAction(getPKey(), state, allowsEntry);
    }
    return gateAction;
}
Ejemplo n.º 3
0
JsonObject*
SamiQueueBody::asJsonObject() {
    JsonObject *pJsonObject = new JsonObject();
    pJsonObject->Construct();

    
    JsonString *pDocumentKey = new JsonString(L"document");
    pJsonObject->Add(pDocumentKey, toJson(getPDocument(), "SamiQueue", ""));

    
    JsonString *pKeyKey = new JsonString(L"key");
    pJsonObject->Add(pKeyKey, toJson(getPKey(), "String", ""));

    
    return pJsonObject;
}
Ejemplo n.º 4
0
JsonObject*
SamiPasswordChangeBody::asJsonObject() {
    JsonObject *pJsonObject = new JsonObject();
    pJsonObject->Construct();

    
    JsonString *pOldPasswordKey = new JsonString(L"oldPassword");
    pJsonObject->Add(pOldPasswordKey, toJson(getPOldPassword(), "String", ""));

    
    JsonString *pNewPasswordKey = new JsonString(L"newPassword");
    pJsonObject->Add(pNewPasswordKey, toJson(getPNewPassword(), "String", ""));

    
    JsonString *pKeyKey = new JsonString(L"key");
    pJsonObject->Add(pKeyKey, toJson(getPKey(), "String", ""));

    
    return pJsonObject;
}