本文整理汇总了C++中parsed函数的典型用法代码示例。如果您正苦于以下问题:C++ parsed函数的具体用法?C++ parsed怎么用?C++ parsed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parsed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: is_write_realization_filename_set
bool reversible_program_options::is_write_realization_filename_set() const
{
if ( !parsed() || !d->has_out_realization )
{
return false;
}
return is_set( "realname" );
}
示例2: ApiTraceFrame
void TraceLoader::parseTrace()
{
QList<ApiTraceFrame*> frames;
int frameCount = 0;
int lastPercentReport = 0;
ApiTraceFrame *currentFrame = new ApiTraceFrame();
currentFrame->number = frameCount;
FrameContents frameCalls;
while (frameCalls.load(this, currentFrame, m_helpHash, m_parser)) {
if (frameCalls.topLevelCount() == frameCalls.allCallsCount()) {
currentFrame->setCalls(frameCalls.allCalls(),
frameCalls.allCalls(),
frameCalls.binaryDataSize());
} else {
currentFrame->setCalls(frameCalls.topLevelCalls(),
frameCalls.allCalls(),
frameCalls.binaryDataSize());
}
frames.append(currentFrame);
if (frames.count() >= FRAMES_TO_CACHE) {
emit framesLoaded(frames);
frames.clear();
}
if (m_parser.percentRead() - lastPercentReport >= 5) {
emit parsed(m_parser.percentRead());
lastPercentReport = m_parser.percentRead();
}
++frameCount;
currentFrame = new ApiTraceFrame();
currentFrame->number = frameCount;
frameCalls.reset();
}
//last frames won't have markers
// it's just a bunch of Delete calls for every object
// after the last SwapBuffers
if (!frameCalls.isEmpty()) {
if (frameCalls.topLevelCount() == frameCalls.allCallsCount()) {
currentFrame->setCalls(frameCalls.allCalls(),
frameCalls.allCalls(),
frameCalls.binaryDataSize());
} else {
currentFrame->setCalls(frameCalls.topLevelCalls(),
frameCalls.allCalls(),
frameCalls.binaryDataSize());
}
frames.append(currentFrame);
}
if (frames.count()) {
emit framesLoaded(frames);
}
}
示例3: QObject
GoogleCalendar::GoogleCalendar(QObject *parent, QString url) :
QObject(parent)
{
QUrl parsed(url);
access_manager = new QNetworkAccessManager(this);
connect(access_manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(dataDownloadComplete(QNetworkReply*)));
connect(access_manager, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)), this, SLOT(dataDownloadSSLError(QNetworkReply*,QList<QSslError>)));
webpath = parsed;
qDebug() << QString("Added calendar for %1").arg(url);
refreshCalendar();
}
示例4: ReplaceFileSystemURL
bool ReplaceFileSystemURL(const char* base,
const URLSegments& baseParsed,
const Replacements<char>& replacements,
URLQueryCharsetConverter* charsetConverter,
URLBuffer<char>& output,
URLSegments* outputParsed)
{
URLComponentSource<char> source(base);
URLSegments parsed(baseParsed);
SetupOverrideComponents(base, replacements, &source, &parsed);
return doCanonicalizeFileSystemURL<char, unsigned char>(base, source, parsed, charsetConverter, output, *outputParsed);
}
示例5: create_cmd_params
po::variables_map create_cmd_params(int argc, char *argv[],
po::options_description const &desc)
{
po::variables_map vm;
po::parsed_options parsed (
po::command_line_parser(argc, argv)
.options(desc)
//.allow_unregistered( )
.run( ));
po::store(parsed, vm);
po::notify(vm);
return vm;
}
示例6: setFocusProxy
void VirtualCluster::addNumberWidget(VirtualClusterLineEdit* pNumberWidget)
{
_number = pNumberWidget;
if (! _number)
return;
_grid->addWidget(_number, 0, 1);
setFocusProxy(pNumberWidget);
connect(_number, SIGNAL(newId(int)), this, SIGNAL(newId(int)));
connect(_number, SIGNAL(parsed()), this, SLOT(sRefresh()));
connect(_number, SIGNAL(valid(bool)), this, SIGNAL(valid(bool)));
}
示例7: read_commandline
static int read_commandline(options& opt, std::vector<std::string>& args)
{
boost::program_options::options_description o_general("Options");
o_general.add_options()
("help,h", "display this message")
("api,a", boost::program_options::value(&opt.api_host), "api host (default: api.supermarx.nl)")
("config,C", boost::program_options::value(&opt.config), "path to the configfile (default: ./config.yaml)");
boost::program_options::variables_map vm;
boost::program_options::options_description options("Allowed options");
options.add(o_general);
boost::program_options::parsed_options parsed(boost::program_options::command_line_parser(args).options(options).allow_unregistered().run());
boost::program_options::store(parsed, vm);
args = boost::program_options::collect_unrecognized(parsed.options, boost::program_options::include_positional);
try
{
boost::program_options::notify(vm);
} catch(const boost::program_options::required_option &e)
{
std::cerr << "You forgot this: " << e.what() << std::endl;
return EXIT_FAILURE;
}
if(vm.count("help"))
{
std::cout
<< "SuperMarx commandline interface Paul. [https://github.com/SuperMarx/paul]" << std::endl
<< "Usage [1]: ./paul [options] <empty>" << std::endl
<< " Drops Paul into an interactive shell." << std::endl
<< "Usage [2]: ./paul [options] action" << std::endl
<< std::endl
<< "Actions:" << std::endl
<< " login logs an user in" << std::endl
<< " quit drops from the interactive cell (if applicable)" << std::endl
<< std::endl
<< o_general;
return EXIT_FAILURE;
}
if(!vm.count("api"))
opt.api_host = "https://api.supermarx.nl";
if(!vm.count("config"))
opt.config = "./config.yaml";
return EXIT_SUCCESS;
}
示例8: operator
/// @brief Handle an alias element
void operator()(elements::AliasElement const &elt) {
// This is an alias.
ParsedAlias parsed(elt.getSource());
if (!parsed.isValid()) {
OSVR_DEV_VERBOSE("Couldn't parse alias: " << elt.getSource());
return;
}
/// @todo update the element with the normalized source?
if (!parsed.isSimple()) {
// Not simple: store the full string as a transform.
m_source.nestTransform(parsed.getAliasValue());
}
m_recurse(parsed.getLeaf());
}
示例9: qDebug
void CrmClusterLineEdit::silentSetId(const int pId)
{
if (DEBUG)
qDebug("VCLE %s::silentSetId(%d)", qPrintable(objectName()), pId);
if (pId == -1)
{
XLineEdit::clear();
_model = new QSqlQueryModel(this);
}
else
{
XSqlQuery idQ;
idQ.prepare(_query + _idClause + QString(";"));
idQ.bindValue(":id", pId);
idQ.exec();
if (idQ.first())
{
if (_completer)
static_cast<QSqlQueryModel* >(_completer->model())->setQuery(QSqlQuery());
_id = pId;
_valid = true;
_model->setQuery(idQ);
setText(idQ.value("number").toString());
if (_hasName)
_name = (idQ.value("name").toString());
if (_hasDescription)
_description = idQ.value("description").toString();
if (_hasActive)
setStrikeOut(!idQ.value("active").toBool());
if (_hasOwner)
_owner = idQ.value("owner").toString();
if (_hasAssignto)
_assignto = idQ.value("assignto").toString();
}
else if (idQ.lastError().type() != QSqlError::NoError)
QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.")
.arg(__FILE__)
.arg(__LINE__),
idQ.lastError().databaseText());
}
_parsed = true;
sHandleNullStr();
emit parsed();
}
示例10: description
void
yg::GetOptions (int argc,
char **argv,
std::string &input,
std::string &output,
std::vector <std::string> &tools)
{
po::options_description description ("Options");
description.add_options ()
("input,i",
po::value <std::string> (&input)->required (),
"File to read template from")
("output,o",
po::value <std::string> (&output)->required (),
"File to write result to")
("extra,e",
po::value <std::vector <std::string>> (&tools)->multitoken (),
"Extra options");
po::positional_options_description positionalDescription;
positionalDescription.add ("extra", -1);
po::variables_map vm;
po::command_line_parser parser (argc, argv);
po::parsed_options parsed (parser.options (description)
.positional (positionalDescription)
.allow_unregistered ()
.run ());
po::store (parsed,
vm);
try
{
po::notify (vm);
}
catch (std::exception const &e)
{
std::stringstream ss;
ss << e.what () << std::endl;
ss << "Options Available: " << description << std::endl;
throw std::logic_error (ss.str ());
}
}
示例11: data
void LocString::readString(uint32 languageID, Common::SeekableReadStream &stream) {
uint32 length = stream.readUint32LE();
std::pair<StringMap::iterator, bool> s = _strings.insert(std::make_pair(languageID, ""));
if (length == 0)
return;
s.first->second = "[???]";
Common::ScopedPtr<Common::MemoryReadStream> data(stream.readStream(length));
Common::ScopedPtr<Common::MemoryReadStream> parsed(LangMan.preParseColorCodes(*data));
Common::Encoding encoding = LangMan.getEncodingLocString(LangMan.getLanguageGendered(languageID));
if (encoding != Common::kEncodingInvalid)
s.first->second = Common::readString(*parsed, encoding);
}
示例12: text
// TODO: can we get _recip_id and _recip_type using the inherited sParse()?
void QuoteLineEdit::sParse()
{
if (! _parsed)
{
QString stripped = text().trimmed().toUpper();
if (stripped.length() == 0)
{
_parsed = true;
setId(-1);
}
else
{
XSqlQuery numQ;
numQ.prepare(_query + _numClause +
(_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) +
QString(";"));
numQ.bindValue(":number", "^" + stripped);
numQ.exec();
if (numQ.first())
{
_valid = true;
setId(numQ.value("id").toInt());
if (_hasName)
_name = numQ.value("name").toString();
if (_hasDescription)
_description = numQ.value("description").toString();
_recip_id = numQ.value("recip_id").toInt();
_recip_type = numQ.value("recip_type").toString();
}
else
{
setId(-1);
if (numQ.lastError().type() != QSqlError::NoError)
QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.")
.arg(__FILE__)
.arg(__LINE__),
numQ.lastError().databaseText());
}
}
emit valid(_valid);
emit parsed();
}
_parsed = true;
sHandleNullStr();
}
示例13: it
QJSValue RequestPrototype::query(const QJSValue &query)
{
if (query.isObject()) {
JSValueIterator it(query);
while (it.next()) {
m_query.addQueryItem(
it.name(),
it.value().toString());
}
} else if (query.isString()) {
QUrlQuery parsed(query.toString());
QList<QPair<QString, QString> > items =
parsed.queryItems(QUrl::FullyDecoded);
QPair<QString, QString> pair;
foreach(pair, items) {
m_query.addQueryItem(pair.first, pair.second);
}
示例14: CreateFile
bool Device::open(boost::asio::io_service &io_service, std::shared_ptr<ICallback> callback)
{
auto handle = CreateFile(m_path.c_str(), GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ,
NULL, OPEN_EXISTING,
FILE_FLAG_OVERLAPPED, NULL);
if(handle == INVALID_HANDLE_VALUE) {
return false;
}
m_handle=std::shared_ptr<void>(handle, &::CloseHandle);
// get hid caps
{
HIDP_PREPARSED_DATA* preparsedData=0;
if (!HidD_GetPreparsedData(handle, &preparsedData)){
return false;
}
std::shared_ptr<HIDP_PREPARSED_DATA> parsed(
preparsedData, HidD_FreePreparsedData);
HIDP_CAPS caps;
if (HidP_GetCaps(preparsedData, &caps) != HIDP_STATUS_SUCCESS)
{
return false;
}
std::cout << "Usage: " << caps.Usage << std::endl;
std::cout << "UsagePage: " << caps.UsagePage << std::endl;
std::cout << "InputReportByteLength: "
<< caps.InputReportByteLength << std::endl;
std::cout << "OutputReportByteLength: "
<< caps.OutputReportByteLength << std::endl;
std::cout << "FeatureReportByteLength: "
<< caps.FeatureReportByteLength << std::endl;
}
// setup stream
m_stream=std::make_shared<boost::asio::windows::stream_handle>(io_service, handle);
m_callback=callback;
beginRead();
m_callback->onConnect(this);
return true;
}
示例15: try_main
static
void
try_main(int argc,char* argv[]) {
strelka_options opt;
for (int i(0); i<argc; ++i) {
if (i) opt.cmdline += ' ';
opt.cmdline += argv[i];
}
initialize_blt_signals(pinfo.name(),opt.cmdline.c_str());
std::vector<std::string> legacy_starling_args;
po::variables_map vm;
try {
po::options_description visible(get_strelka_option_parser(opt));
po::options_description visible2(get_starling_shared_option_parser(opt));
visible.add(visible2);
po::parsed_options parsed(po::command_line_parser(argc,argv).options(visible).allow_unregistered().run());
po::store(parsed,vm);
po::notify(vm);
// allow remaining options to be parsed using starling command-line parser:
legacy_starling_args = po::collect_unrecognized(parsed.options,po::include_positional);
} catch (const boost::program_options::error& e) {
pinfo.usage(e.what());
}
if ((argc==1) or vm.count("help")) {
pinfo.usage();
}
// temp workaround for blt/starling options which are not (yet)
// under program_options control:
//
arg_data ad(legacy_starling_args,pinfo,opt.cmdline);
legacy_starling_arg_parse(ad,opt);
finalize_strelka_options(pinfo,vm,opt);
strelka_run(opt);
}