当前位置: 首页>>代码示例>>C++>>正文


C++ Assignment::getUUIDStringWithoutCurlyBraces方法代码示例

本文整理汇总了C++中Assignment::getUUIDStringWithoutCurlyBraces方法的典型用法代码示例。如果您正苦于以下问题:C++ Assignment::getUUIDStringWithoutCurlyBraces方法的具体用法?C++ Assignment::getUUIDStringWithoutCurlyBraces怎么用?C++ Assignment::getUUIDStringWithoutCurlyBraces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assignment的用法示例。


在下文中一共展示了Assignment::getUUIDStringWithoutCurlyBraces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: civetwebUploadHandler

void DomainServer::civetwebUploadHandler(struct mg_connection *connection, const char *path) {
    
    // create an assignment for this saved script, for now make it local only
    Assignment *scriptAssignment = new Assignment(Assignment::CreateCommand, Assignment::AgentType, Assignment::LocalLocation);
    
    // check how many instances of this assignment the user wants by checking the ASSIGNMENT-INSTANCES header
    const char ASSIGNMENT_INSTANCES_HTTP_HEADER[] = "ASSIGNMENT-INSTANCES";
    const char *requestInstancesHeader = mg_get_header(connection, ASSIGNMENT_INSTANCES_HTTP_HEADER);
    
    if (requestInstancesHeader) {
        // the user has requested a number of instances greater than 1
        // so set that on the created assignment
        scriptAssignment->setNumberOfInstances(atoi(requestInstancesHeader));
    }
    
    QString newPath(ASSIGNMENT_SCRIPT_HOST_LOCATION);
    newPath += "/";
    // append the UUID for this script as the new filename, remove the curly braces
    newPath += scriptAssignment->getUUIDStringWithoutCurlyBraces();
    
    // rename the saved script to the GUID of the assignment and move it to the script host locaiton
    rename(path, newPath.toLocal8Bit().constData());
    
    qDebug("Saved a script for assignment at %s\n", newPath.toLocal8Bit().constData());
    
    // add the script assigment to the assignment queue
    // lock the assignment queue mutex since we're operating on a different thread than DS main
    domainServerInstance->_assignmentQueueMutex.lock();
    domainServerInstance->_assignmentQueue.push_back(scriptAssignment);
    domainServerInstance->_assignmentQueueMutex.unlock();
}
开发者ID:heracek,项目名称:hifi,代码行数:31,代码来源:DomainServer.cpp

示例2: mongooseUploadHandler

static void mongooseUploadHandler(struct mg_connection *conn, const char *path) {
    // create an assignment for this saved script, for now make it local only
    Assignment *scriptAssignment = new Assignment(Assignment::CreateCommand, Assignment::AgentType, Assignment::LocalLocation);
    
    QString newPath(ASSIGNMENT_SCRIPT_HOST_LOCATION);
    newPath += "/";
    // append the UUID for this script as the new filename, remove the curly braces
    newPath += scriptAssignment->getUUIDStringWithoutCurlyBraces();
    
    // rename the saved script to the GUID of the assignment and move it to the script host locaiton
    rename(path, newPath.toStdString().c_str());

    qDebug("Saved a script for assignment at %s\n", newPath.toStdString().c_str());
    
    // add the script assigment to the assignment queue
    // lock the assignment queue mutex since we're operating on a different thread than DS main
    ::assignmentQueueMutex.lock();
    ::assignmentQueue.push_back(scriptAssignment);
    ::assignmentQueueMutex.unlock();

}
开发者ID:mvpeng,项目名称:hifi,代码行数:21,代码来源:main.cpp


注:本文中的Assignment::getUUIDStringWithoutCurlyBraces方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。