本文整理汇总了C++中parseArg函数的典型用法代码示例。如果您正苦于以下问题:C++ parseArg函数的具体用法?C++ parseArg怎么用?C++ parseArg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parseArg函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ICUException
static PyObject *t_resourcebundle_get(t_resourcebundle *self, PyObject *arg)
{
UErrorCode status = U_ZERO_ERROR;
charsArg key;
int i;
if (!parseArg(arg, "i", &i))
{
ResourceBundle rb = self->object->get(i, status);
if (U_FAILURE(status))
return ICUException(status).reportError();
return wrap_ResourceBundle(rb);
}
if (!parseArg(arg, "n", &key))
{
ResourceBundle rb = self->object->get(key, status);
if (U_FAILURE(status))
return ICUException(status).reportError();
return wrap_ResourceBundle(rb);
}
return PyErr_SetArgsError((PyObject *) self, "get", arg);
}
开发者ID:ezmiller,项目名称:pyicu,代码行数:28,代码来源:locale.cpp
示例2: rvmInitOptions
jboolean rvmInitOptions(int argc, char* argv[], Options* options, jboolean ignoreRvmArgs) {
char path[PATH_MAX];
if (!realpath(argv[0], path)) {
return FALSE;
}
strcpy(options->executablePath, path);
jint i = strlen(path);
while (i >= 0 && path[i] != '/') {
path[i--] = '\0';
}
if (i >= 0 && path[i] == '/') {
path[i] = '\0';
}
strcpy(options->basePath, path);
// Look for a robovm.ini next to the executable
strcat(path, "/robovm.ini");
FILE* f = fopen(path, "r");
if (f) {
char* line = NULL;
size_t linecap = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linecap, f)) > 0) {
line = trim(line);
if (strlen(line) > 0 && line[0] != '#') {
parseArg(line, options);
}
}
if (line) {
free(line);
}
fclose(f);
}
jint firstJavaArg = 1;
for (i = 1; i < argc; i++) {
if (startsWith(argv[i], "-rvm:")) {
if (!ignoreRvmArgs) {
char* arg = &argv[i][5];
parseArg(arg, options);
}
firstJavaArg++;
} else {
break;
}
}
options->commandLineArgs = NULL;
options->commandLineArgsCount = argc - firstJavaArg;
if (options->commandLineArgsCount > 0) {
options->commandLineArgs = &argv[firstJavaArg];
}
return options->mainClass != NULL;
}
开发者ID:mpr90,项目名称:robovm,代码行数:58,代码来源:init.c
示例3: PyErr_SetArgsError
static PyObject *t_regexpattern_richcmp(t_regexpattern *self,
PyObject *arg, int op)
{
RegexPattern *pattern;
int b = 0;
if (!parseArg(arg, "P", TYPE_CLASSID(RegexPattern), &pattern))
{
switch (op) {
case Py_EQ:
case Py_NE:
b = *self->object == *pattern;
if (op == Py_EQ)
Py_RETURN_BOOL(b);
Py_RETURN_BOOL(!b);
case Py_LT:
case Py_LE:
case Py_GT:
case Py_GE:
PyErr_SetNone(PyExc_NotImplementedError);
return NULL;
}
}
return PyErr_SetArgsError((PyObject *) self, "__richcmp__", arg);
}
开发者ID:fish2000,项目名称:pyicu-praxa,代码行数:26,代码来源:regex.cpp
示例4: PyErr_SetArgsError
static PyObject *t_forwardcharacteriterator_richcmp(t_forwardcharacteriterator *self, PyObject *arg, int op)
{
int b = 0;
ForwardCharacterIterator *i;
if (!parseArg(arg, "P", TYPE_ID(ForwardCharacterIterator), &i))
{
switch (op) {
case Py_EQ:
case Py_NE:
b = *self->object == *i;
if (op == Py_EQ)
Py_RETURN_BOOL(b);
Py_RETURN_BOOL(!b);
case Py_LT:
case Py_LE:
case Py_GT:
case Py_GE:
PyErr_SetNone(PyExc_NotImplementedError);
return NULL;
}
}
return PyErr_SetArgsError((PyObject *) self, "__richcmp__", arg);
}
开发者ID:nikolamilosevic86,项目名称:SerbianComparisonExtractor,代码行数:25,代码来源:iterators.cpp
示例5: parseLoop
void parseLoop (void)
{
char* cnd;
const char* cmd[MAX_ARGS];
char input[MAX_BUFFER];
int argc;
do {
clean(cmd);
argc = parseArg(cnd, cmd, input);
if (argc == 0) {
continue;
}
// Is the poor soul asking for help ? Give him some succour
if (strcmp(cmd[0], "help") == 0 ||
strcmp(cmd[0], "?") == 0) {
help();
continue;
}
// Are we done ?
if (strcmp(cmd[0], "exit") == 0 || strcmp(cmd[0], "quit") == 0 ) {
break;
}
execute(argc, cmd);
} while (true);
return;
}
开发者ID:nkumar43212,项目名称:e2,代码行数:30,代码来源:AgentClientParser.hpp
示例6: parseAndSet_b
inline void parseAndSet_b(const TString& input, TString arg, bool& value) {
TString newval = parseArg(input, arg);
if (!newval.IsNull()) {
if (newval.IsBin()) value = newval.Atoi();
else if (newval == "true") value = true;
else if (newval == "false") value = false;
}
}
开发者ID:cmstas,项目名称:StopAnalysis,代码行数:8,代码来源:makeBkgEstimates.C
示例7: main
int main(int argc, char* argv[])
{
parseArg();
connectToBootRom();
dlBootLoader();
return 0;
}
开发者ID:llyanGithub,项目名称:c-exercise,代码行数:8,代码来源:main.c
示例8: assert
void
CApp::parseArgs(int argc, const char* const* argv, int& i)
{
// about these use of assert() here:
// previously an /analyze warning was displayed if we only used assert and
// did not return on failure. however, this warning does not appear to show
// any more (could be because new compiler args have been added).
// the asserts are programmer benefit only; the os should never pass 0 args,
// because the first is always the binary name. the only way assert would
// evaluate to true, is if this parse function were implemented incorrectly,
// which is unlikely because it's old code and has a specific use.
// we should avoid using anything other than assert here, because it will
// look like important code, which it's not really.
assert(argsBase().m_pname != NULL);
assert(argv != NULL);
assert(argc >= 1);
// set defaults
argsBase().m_name = ARCH->getHostName();
LOG((CLOG_INFO "CApp::parseArgs call"));
// parse options
for (i = 1; i < argc; ++i) {
if (parseArg(argc, argv, i)) {
continue;
}
else if (isArg(i, argc, argv, "--", NULL)) {
// remaining arguments are not options
++i;
break;
}
else if (argv[i][0] == '-') {
std::cerr << "Unrecognized option: " << argv[i] << std::endl;
m_bye(kExitArgs);
}
else {
// this and remaining arguments are not options
break;
}
}
#if SYSAPI_WIN32
// suggest that user installs as a windows service. when launched as
// service, process should automatically detect that it should run in
// daemon mode.
if (argsBase().m_daemon) {
LOG((CLOG_ERR
"The --daemon argument is not supported on Windows. "
"Instead, install %s as a service (--service install).",
argsBase().m_pname));
m_bye(kExitArgs);
}
#endif
}
开发者ID:rosedu,项目名称:synergy,代码行数:58,代码来源:CApp.cpp
示例9: PyInt_FromLong
static PyObject *t_collationelementiterator_tertiaryOrder(PyTypeObject *type, PyObject *arg)
{
int i;
if (!parseArg(arg, "i", &i))
return PyInt_FromLong(CollationElementIterator::tertiaryOrder(i));
return PyErr_SetArgsError(type, "tertiaryOrder", arg);
}
开发者ID:nikolamilosevic86,项目名称:SerbianComparisonExtractor,代码行数:9,代码来源:iterators.cpp
示例10: STATUS_CALL
static PyObject *t_searchiterator_setText(t_searchiterator *self, PyObject *arg)
{
UnicodeString *u;
CharacterIterator *chars;
if (!parseArg(arg, "W", &u, &self->text))
{
STATUS_CALL(self->object->setText(*u, status)); /* ref'd */
Py_RETURN_NONE;
}
else if (!parseArg(arg, "P", TYPE_ID(CharacterIterator), &chars))
{
STATUS_CALL(self->object->setText(*chars, status)); /* copied */
Py_RETURN_NONE;
}
return PyErr_SetArgsError((PyObject *) self, "setText", arg);
}
开发者ID:ezmiller,项目名称:pyicu,代码行数:18,代码来源:search.cpp
示例11: main
int main(int argc, char *argv[])
{
// Задание кодировки приложения
#ifndef QT_NO_TEXTCODEC
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
#endif
/// Параметр -debug влияет на вывод qDebug() в консоль.
parseArg(argc, argv);
QApplication app(argc, argv);
// Заполняем глобальные переменные
QFileInfo mainFile(app.applicationFilePath());
if (app.applicationName().isEmpty()) {
app.setApplicationName( mainFile.baseName() );
}
if (app.applicationVersion().isEmpty()) {
qApp->setApplicationVersion(QString("%1.%2.%3").arg(VERSION_MAJOR).arg(VERSION_MINOR).arg(VERSION_PATCH));
}
QDir *mainDir = new QDir(SettingsFile::getDefaultUserDataPath());
mainDir->mkpath(mainDir->path());
delete mainDir;
// Перенаправляем вывод отладочной информации в файл
// On Unix: Projects > Run Settings > Run in terminal
qInstallMsgHandler(myMessageOutput);
// Инициируем перевод через Qt Linguist
const QString localeFile = SettingsFile::getDefaultResourcePath()
+ "/translations/"
+ mainFile.baseName()
+ "_"
+ QLocale::system().name();
QTranslator translator;
if (!translator.load( localeFile )) {
qDebug() << "Can't load QM (TS):" << localeFile;
}
app.installTranslator(&translator);
// Для Win32 указываем искать плагины в директории с приложением
#if defined(Q_WS_WIN32)
app.addLibraryPath(app.applicationDirPath());
#endif
MainWindow w;
w.show();
return app.exec();
}
开发者ID:QuAzI,项目名称:POST000-Converter,代码行数:54,代码来源:main.cpp
示例12: PyErr_SetArgsError
static PyObject *t_stringsearch_setPattern(t_stringsearch *self, PyObject *arg)
{
UnicodeString *u, _u;
if (!parseArg(arg, "S", &u, &_u))
{
STATUS_CALL(self->object->setPattern(*u, status)); /* copied */
Py_RETURN_NONE;
}
return PyErr_SetArgsError((PyObject *) self, "setPattern", arg);
}
开发者ID:ezmiller,项目名称:pyicu,代码行数:12,代码来源:search.cpp
示例13: PyUnicode_FromUnicodeString
static PyObject *t_regexmatcher_replaceAll(t_regexmatcher *self, PyObject *arg)
{
UnicodeString *u, _u, result;
if (!parseArg(arg, "S", &u, &_u))
{
STATUS_CALL(result = self->object->replaceAll(*u, status));
return PyUnicode_FromUnicodeString(&result);
}
return PyErr_SetArgsError((PyObject *) self, "replaceAll", arg);
}
开发者ID:fish2000,项目名称:pyicu-praxa,代码行数:12,代码来源:regex.cpp
示例14: PyErr_SetArgsError
static PyObject *t_locale_removeKeywordValue(t_locale *self, PyObject *arg)
{
charsArg name;
if (!parseArg(arg, "n", &name))
{
STATUS_CALL(self->object->setKeywordValue(name, "", status));
Py_RETURN_NONE;
}
return PyErr_SetArgsError((PyObject *) self, "removeKeywordValue", arg);
}
开发者ID:ezmiller,项目名称:pyicu,代码行数:12,代码来源:locale.cpp
示例15: Formattable
Formattable *toFormattable(PyObject *arg)
{
UDate date;
double d;
int i;
PY_LONG_LONG l;
UnicodeString *u;
UnicodeString _u;
char *s;
if (!parseArg(arg, "d", &d))
return new Formattable(d);
if (!parseArg(arg, "i", &i))
return new Formattable(i);
if (!parseArg(arg, "L", &l))
return new Formattable((int64_t) l);
if (!parseArg(arg, "c", &s))
return new Formattable(s);
if (!parseArg(arg, "S", &u, &_u))
return new Formattable(*u);
if (!parseArg(arg, "E", &date))
return new Formattable(date, Formattable::kIsDate);
return NULL;
}
开发者ID:kluge-iitk,项目名称:pyicu,代码行数:30,代码来源:common.cpp
示例16: PyInt_FromLong
static PyObject *t_searchiterator_getAttribute(t_searchiterator *self,
PyObject *arg)
{
USearchAttribute attribute;
if (!parseArg(arg, "i", &attribute))
{
USearchAttributeValue value = self->object->getAttribute(attribute);
return PyInt_FromLong(value);
}
return PyErr_SetArgsError((PyObject *) self, "getAttribute", arg);
}
开发者ID:ezmiller,项目名称:pyicu,代码行数:13,代码来源:search.cpp
注:本文中的parseArg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论