本文整理汇总了C++中Queue::RunCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ Queue::RunCommand方法的具体用法?C++ Queue::RunCommand怎么用?C++ Queue::RunCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Queue
的用法示例。
在下文中一共展示了Queue::RunCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StopPrint
int Queue::StopPrint(BaseObj *obj, char **output, BaseObj * /*requestor*/)
{
Queue *queue = (Queue *)obj;
char *command = new char[100];
int rc;
sprintf(command, STOP_PRINTING_CMD, queue->Name());
rc = queue->RunCommand(command, NULL, output);
delete [] command;
return rc;
}
示例2: Stop
int Queue::Stop(BaseObj *obj, char **output, BaseObj * /*requestor*/)
{
Queue *queue = (Queue *)obj;
char *command = new char[100];
int rc;
#ifdef aix
if (queue->n_devices > 1)
{
sprintf(command, STOP_QUEUE_CMD, "$d");
int i, len;
len = 30 + strlen(command) + queue->n_devices;
for (i = 0; i < queue->n_devices; i++)
len += strlen(queue->local_devices[i]);
char *cmd = new char[len];
strcpy(cmd, "for d in");
for (i = 0; i < queue->n_devices; i++)
{
strcat(cmd, " ");
strcat(cmd, queue->local_devices[i]);
}
strcat(cmd, " ; do ");
strcat(cmd, command);
strcat(cmd, "; done");
rc = queue->RunCommand(cmd, NULL, output);
delete [] cmd;
}
else
#endif
{
sprintf(command, STOP_QUEUE_CMD, queue->Name());
rc = queue->RunCommand(command, NULL, output);
}
delete [] command;
return rc;
}