Lines Matching defs:context
52 bool HdcHostApp::BeginInstall(CtxFile *context, const char *command)
65 context->transferConfig.clientCwd = argv[i + 1];
75 ExtractRelativePath(context->transferConfig.clientCwd, path);
77 context->taskQueue.push_back(path);
81 context->taskQueue.push_back(tarpath);
87 if (!context->taskQueue.size()) {
92 sort(context->taskQueue.begin(), context->taskQueue.end());
93 context->taskQueue.erase(unique(context->taskQueue.begin(), context->taskQueue.end()), context->taskQueue.end());
95 context->transferConfig.options = options;
96 context->transferConfig.functionName = CMDSTR_APP_INSTALL;
97 ret = RunQueue(context);
105 bool HdcHostApp::BeginSideload(CtxFile *context, const char *localPath)
108 context->transferConfig.functionName = CMDSTR_APP_SIDELOAD;
109 context->taskQueue.push_back(localPath);
110 ret = RunQueue(context);
114 bool HdcHostApp::RunQueue(CtxFile *context)
116 context->localPath = context->taskQueue.back();
120 OnFileOpenFailed(context);
124 openReq->data = context;
126 uv_fs_open(loopTask, openReq, context->localPath.c_str(), O_RDONLY, 0, OnFileOpen);
127 context->master = true;
131 void HdcHostApp::CheckMaster(CtxFile *context)
134 uv_fs_fstat(nullptr, &fs, context->openFd, nullptr);
135 context->transferConfig.fileSize = fs.statbuf.st_size;
138 context->transferConfig.optionalName
140 if (context->localPath.find(".hap") != static_cast<size_t>(-1)) {
141 context->transferConfig.optionalName += ".hap";
142 } else if (context->localPath.find(".hsp") != static_cast<size_t>(-1)) {
143 context->transferConfig.optionalName += ".hsp";
144 } else if (context->localPath.find(".tar") != static_cast<size_t>(-1)) {
145 context->transferConfig.optionalName += ".tar";
147 context->transferConfig.optionalName += ".bundle";
149 string bufString = SerialStruct::SerializeToString(context->transferConfig);