本文整理汇总了C++中identifier函数的典型用法代码示例。如果您正苦于以下问题:C++ identifier函数的具体用法?C++ identifier怎么用?C++ identifier使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了identifier函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: createScalarField
bool MutableMessage::addScalarField(const char *field, const uint8_t &value) {
auto e = createScalarField(m_field_allocator, field, value);
auto result = m_keys.insert(std::make_pair(e->identifier(), m_payload.size()));
if (tf::likely(result.second)) {
m_payload.emplace_back(e);
} else {
destroyField(m_field_allocator, e);
}
return result.second;
}
开发者ID:wannabegeek,项目名称:DCM,代码行数:10,代码来源:MutableMessage.cpp
示例2: position
Stmt* Parser::useStatement()
{
uint32_t pos = position();
eat(T_Use);
if (!(hd() == T_Identifier && identValue() == compiler->SYM_namespace))
compiler->syntaxError(pos, SYNTAXERR_ILLEGAL_USE);
eat(T_Identifier);
Str* ns = identifier();
return ALLOC(UseNamespaceStmt, (pos, ns));
}
开发者ID:changm,项目名称:tessa,代码行数:10,代码来源:eval-parse-stmt.cpp
示例3: CommandResult
CommandResult::SharedConst TotalBalancesCommand::resultOk(
string &totalBalancesStr) const
{
return CommandResult::SharedConst(
new CommandResult(
identifier(),
UUID(),
200,
totalBalancesStr));
}
开发者ID:GEO-Project,项目名称:GEO-Project,代码行数:10,代码来源:TotalBalancesCommand.cpp
示例4: position
Stmt* Parser::useStatement()
{
uint32_t pos = position();
eat(T_Use);
if (!match(T_Namespace))
compiler->syntaxError(pos, SYNTAXERR_ILLEGAL_USE);
Str* ns = identifier();
addOpenNamespace(ALLOC(NamespaceRef, (ns)));
return ALLOC(EmptyStmt, ());
}
开发者ID:bsdf,项目名称:trx,代码行数:10,代码来源:eval-parse-stmt.cpp
示例5: ASSERT
void ThreadIdentifierData::initialize(ThreadIdentifier id)
{
ASSERT(!identifier());
#if !ENABLE(SAMSUNG_WEBKIT_PERFORMANCE_PATCH)
// SAMSUNG CHANGE : Webkit Performance Patch Merge + r92154
initializeKeyOnce();
// SAMSUNG CHANGE : Webkit Performance Patch Merge -
#endif
pthread_setspecific(m_key, new ThreadIdentifierData(id));
}
开发者ID:johnwpoliver,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:11,代码来源:ThreadIdentifierDataPthreads.cpp
示例6: eat
CatchClause* Parser::catchClause()
{
eat (T_LeftParen);
Str* catchvar_name = identifier();
Type* catchvar_type_name = NULL;
if (match(T_Colon))
catchvar_type_name = typeExpression();
eat (T_RightParen);
Seq<Stmt*>* catchblock = statementBlock();
return ALLOC(CatchClause, (catchvar_name, catchvar_type_name, catchblock));
}
开发者ID:bsdf,项目名称:trx,代码行数:11,代码来源:eval-parse-stmt.cpp
示例7: advance
void Scanner::scanToken()
{
char c = advance();
switch (c) {
case '(': addToken(LEFT_PAREN); break;
case ')': addToken(RIGHT_PAREN); break;
case '{': addToken(LEFT_BRACE); break;
case '}': addToken(RIGHT_BRACE); break;
case ',': addToken(COMMA); break;
case '.': addToken(DOT); break;
case '-': addToken(MINUS); break;
case '+': addToken(PLUS); break;
case ';': addToken(SEMICOLON); break;
case '*': addToken(STAR); break;
case '!': addToken(match('=') ? BANG_EQUAL : BANG); break;
case '=': addToken(match('=') ? EQUAL_EQUAL : EQUAL); break;
case '<': addToken(match('=') ? LESS_EQUAL : LESS); break;
case '>': addToken(match('=') ? GREATER_EQUAL : GREATER); break;
case '/':
if (match('/'))
{
while (peek() != '\n' && !isAtEnd()) advance();
}
else
{
addToken(SLASH);
}
break;
case ' ':
case '\r':
case '\t':
// Ignore whitespace.
break;
case '\n':
line_++;
break;
case '"': string(); break;
default:
if (isDigit(c))
{
number();
}
else if (isAlpha(c))
{
identifier();
}
else
{
error(line_, "Unexpected character.");
}
break;
}
}
开发者ID:remiznik,项目名称:tests,代码行数:54,代码来源:Scanner.cpp
示例8: text
void LineEdit::checkContent()
{
if (text().length()>=2 && currentBegin!=text().mid(0,2).toLower()) {
currentBegin = text().mid(0,2).toLower();
networkManager->sendGetStationsRequest(currentBegin,identifier());
//qDebug()<<"id "<<identifier();
}
//QUrl decode cyrillic letters automatically
//networkManager->sendGetStationsRequest(QUrl::toPercentEncoding(currentBegin),identifier());
}
开发者ID:dimininio,项目名称:TicketScanner,代码行数:11,代码来源:lineedit.cpp
示例9: while
AST *
PreProcessor::expression()
{
List<Token> exps;
while (!tokenit.eof() && !tokenit.is(_PP_END)) {
const Token &t = tokenit.get(0);
switch (t.id) {
case _IDENT: {
bool replaced = identifier();
if (!replaced) {
exps.push_back(t);
}
continue;
}
//'defined' expression is pre-evaluated here
case _PP_DEFINED: {
tokenit.next();
bool lparen = tokenit.eat(_LPAREN);
if (!tokenit.is(_IDENT)){
ERROR("'defined' error");
}
bool defined = isDefined(tokenit.val()->toString());
tokenit.next();
if (lparen && !tokenit.eat(_RPAREN)) {
ERROR("'defined' error");
return false;
}
Token newt;
newt.id = _DECIMAL_CONSTANT;
if (defined) {
newt.val = new TokenInt("<defined 1>", 1);
} else {
newt.val = new TokenInt("<defined 0>", 0);
}
exps.push_back(newt);
continue;
}
case _SPC:
//don't push spaces
break;
default:
exps.push_back(t);
}
tokenit.next();
}
DBG("expression %d", exps.size());
ptokens(exps);
DBG("---------");
if (tokenit.is(_PP_END)) {
tokenit.next();
}
return parser.parseConstantExpression(exps);
}
开发者ID:ktok07b6,项目名称:scc,代码行数:54,代码来源:PreProcessor.cpp
示例10: show
void Brick::hit()
{
if (identifier() == "HiddenBrick" && !isVisible()) {
show();
++m_game->m_remainingBricks;
} else if (identifier() == "MultipleBrick3") {
setIdentifier("MultipleBrick2");
// TODO: make a convenience function out of the following two
m_game->addScore(qRound(m_game->m_dScore));
m_game->m_dScore = BRICK_SCORE;
} else if (identifier() == "MultipleBrick2") {
setIdentifier("MultipleBrick1");
m_game->addScore(qRound(m_game->m_dScore));
m_game->m_dScore = BRICK_SCORE;
} else if (identifier() == "ExplodingBrick") {
explode();
} else if (identifier() != "UnbreakableBrick") {
forcedHit();
}
}
开发者ID:thypon,项目名称:xbreakout,代码行数:20,代码来源:brick.cpp
示例11: forcedHit
void Brick::forcedHit()
{
if (m_deleted) return;
if (identifier() == "ExplodingBrick") {
explode();
} else {
handleDeletion();
}
hide();
}
开发者ID:thypon,项目名称:xbreakout,代码行数:11,代码来源:brick.cpp
示例12: handleTimeout
/// Handle the completion of a timer operation.
void handleTimeout( const boost::system::error_code& e )
{
if ( !e ) {
m_connHandler->signalOccured( ConnectionHandler::TIMEOUT );
LOG_DEBUG << "Timeout on connection to " << identifier();
nextOperation();
}
else {
assert( e == boost::asio::error::operation_aborted );
}
}
开发者ID:Wolframe,项目名称:Wolframe,代码行数:13,代码来源:connectionBase.hpp
示例13: catch
void TCPConnection::send(ByteArray message, std::chrono::milliseconds timeout) const {
try {
socket_->SendData((const int8_t*)message.data(), message.size(), static_cast<uint32_t>(timeout.count()));
} catch (const IVDA::SocketConnectionException& err) {
throw ConnectionClosedError("Connection to peer " + socket_->GetPeerAddress() + " lost during send operation (internal error: " +
err.what() + ")",
identifier(), __FILE__, __LINE__);
} catch (const IVDA::SocketException& err) {
std::string internalError = mocca::joinString(err.what(), ", ", err.internalError());
throw NetworkError("Network error in send operation (internal error: " + internalError + ")", __FILE__, __LINE__);
}
}
开发者ID:waschkbaer,项目名称:BrainVis,代码行数:12,代码来源:TCPConnection.cpp
示例14: createNotEnoughArgumentsError
JSValue JSSubtleCrypto::encrypt(ExecState* exec)
{
if (exec->argumentCount() < 3)
return exec->vm().throwException(exec, createNotEnoughArgumentsError(exec));
auto algorithm = createAlgorithmFromJSValue(exec, exec->uncheckedArgument(0));
if (!algorithm) {
ASSERT(exec->hadException());
return jsUndefined();
}
auto parameters = JSCryptoAlgorithmDictionary::createParametersForEncrypt(exec, algorithm->identifier(), exec->uncheckedArgument(0));
if (!parameters) {
ASSERT(exec->hadException());
return jsUndefined();
}
RefPtr<CryptoKey> key = JSCryptoKey::toWrapped(exec->uncheckedArgument(1));
if (!key)
return throwTypeError(exec);
if (!key->allows(CryptoKeyUsageEncrypt)) {
m_impl->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'encrypt'"));
setDOMException(exec, NOT_SUPPORTED_ERR);
return jsUndefined();
}
CryptoOperationData data;
if (!cryptoOperationDataFromJSValue(exec, exec->uncheckedArgument(2), data)) {
ASSERT(exec->hadException());
return jsUndefined();
}
JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(exec, globalObject());
DeferredWrapper wrapper(exec, globalObject(), promiseDeferred);
auto successCallback = [wrapper](const Vector<uint8_t>& result) mutable {
wrapper.resolve(result);
};
auto failureCallback = [wrapper]() mutable {
wrapper.reject(nullptr);
};
ExceptionCode ec = 0;
algorithm->encrypt(*parameters, *key, data, WTF::move(successCallback), WTF::move(failureCallback), ec);
if (ec) {
setDOMException(exec, ec);
return jsUndefined();
}
return promiseDeferred->promise();
}
开发者ID:LianYue1,项目名称:webkit,代码行数:52,代码来源:JSSubtleCryptoCustom.cpp
示例15: Q_D
/*!
\qmlmethod bool FacebookAlbum::unlike()
Initiates a "delete like" operation on the album.
If the network request was started successfully, the function
will return true and the status of the album will change to
\c SocialNetwork::Busy. Otherwise, the function will return
false.
*/
bool FacebookAlbumInterface::unlike()
{
Q_D(FacebookAlbumInterface);
bool requestMade = request(IdentifiableContentItemInterface::Delete,
identifier(), QLatin1String("likes"));
if (!requestMade)
return false;
d->action = FacebookInterfacePrivate::DeleteLikeAction;
d->connectFinishedAndErrors();
return true;
}
开发者ID:VDVsx,项目名称:nemo-qml-plugins,代码行数:22,代码来源:facebookalbuminterface.cpp
示例16: handleRead
/// Handle completion of a read operation.
void handleRead( const boost::system::error_code& e, std::size_t bytesTransferred )
{
setTimeout( 0 );
if ( !e ) {
LOG_TRACE << "Read " << bytesTransferred << " bytes from " << identifier();
m_connHandler->networkInput( m_readBuffer, bytesTransferred );
}
else {
LOG_TRACE << "Read error: " << e.message();
signalError( e );
}
nextOperation();
}
开发者ID:Wolframe,项目名称:Wolframe,代码行数:14,代码来源:connectionBase.hpp
示例17: DECLARE_THROW_SCOPE
JSValue JSWebKitSubtleCrypto::sign(ExecState& state)
{
VM& vm = state.vm();
auto scope = DECLARE_THROW_SCOPE(vm);
if (state.argumentCount() < 3)
return throwException(&state, scope, createNotEnoughArgumentsError(&state));
auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
ASSERT(scope.exception() || algorithm);
if (!algorithm)
return jsUndefined();
auto parameters = JSCryptoAlgorithmDictionary::createParametersForSign(&state, algorithm->identifier(), state.uncheckedArgument(0));
ASSERT(scope.exception() || parameters);
if (!parameters)
return jsUndefined();
RefPtr<CryptoKey> key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
if (!key)
return throwTypeError(&state, scope);
if (!key->allows(CryptoKeyUsageSign)) {
wrapped().document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'sign'"));
setDOMException(&state, NOT_SUPPORTED_ERR);
return jsUndefined();
}
CryptoOperationData data;
auto success = cryptoOperationDataFromJSValue(&state, state.uncheckedArgument(2), data);
ASSERT(scope.exception() || success);
if (!success)
return jsUndefined();
RefPtr<DeferredPromise> wrapper = createDeferredPromise(state, domWindow());
auto promise = wrapper->promise();
auto successCallback = [wrapper](const Vector<uint8_t>& result) mutable {
fulfillPromiseWithArrayBuffer(wrapper.releaseNonNull(), result.data(), result.size());
};
auto failureCallback = [wrapper]() mutable {
wrapper->reject(nullptr);
};
auto result = algorithm->sign(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback));
if (result.hasException()) {
propagateException(state, scope, result.releaseException());
return { };
}
return promise;
}
开发者ID:ollie314,项目名称:webkit,代码行数:51,代码来源:JSWebKitSubtleCryptoCustom.cpp
示例18: BaseUserCommand
TotalBalancesCommand::TotalBalancesCommand(
const CommandUUID &uuid,
const string &commandBuffer):
BaseUserCommand(
uuid,
identifier())
{
const auto minCommandLength = 2;
if (commandBuffer.size() < minCommandLength) {
throw ValueError("TotalBalancesCommand: "
"Can't parse command. Received command is to short.");
}
size_t tokenSeparatorPos = commandBuffer.find(kTokensSeparator);
string gatewaysCountStr = commandBuffer.substr(
0,
tokenSeparatorPos);
if (gatewaysCountStr.at(0) == '-') {
throw ValueError("TotalBalancesCommand: "
"Can't parse command. 'count gateways' token can't be negative.");
}
try {
mGatewaysCount = std::stoul(gatewaysCountStr);
} catch (...) {
throw ValueError("TotalBalancesCommand: "
"Can't parse command. Error occurred while parsing 'count gateways' token.");
}
if (mGatewaysCount == 0) {
return;
}
mGateways.reserve(mGatewaysCount);
size_t gatewayStartPoint = tokenSeparatorPos + 1;
for (size_t idx = 0; idx < mGatewaysCount; idx++) {
try {
string hexUUID = commandBuffer.substr(
gatewayStartPoint,
NodeUUID::kHexSize);
mGateways.push_back(
boost::lexical_cast<uuids::uuid>(
hexUUID));
gatewayStartPoint += NodeUUID::kHexSize + 1;
} catch (...) {
throw ValueError("TotalBalancesCommand: "
"Can't parse command. Error occurred while parsing 'Gateway UUID' token.");
}
}
if (gatewayStartPoint + 1 < commandBuffer.length()) {
throw ValueError("TotalBalancesCommand: "
"Can't parse command. Disparity between command count gateways and real count gateways.");
}
}
开发者ID:GEO-Project,项目名称:GEO-Project,代码行数:51,代码来源:TotalBalancesCommand.cpp
示例19: term
void term(){
if(look == '*'){
match("*");
term();
emitln("xor ebx, ebx");
settype(reduceptr(current_type));
STRSWITCH(current_type)
STRCASE("short")
emitln("mov bx, word [eax]");
STRCASE("char")
emitln("mov bl, byte [eax]");
STRDEFAULT
emitln("mov ebx, dword [eax]");
STRSWITCHEND
emitln("xchg eax, ebx");
} else if(look == '('){
match("(");
emitln("push eax");
expression();
match(")");
}
else if(look == '"'){
emitln("mov eax, %s", add_string(getstring('"')));
current_type = "char*";
}
else if(look == '\''){
match("'");
emitln("mov eax, %d", look);
getcharacter();
match("'");
current_type = "char";
}
else if(is_in(dynstring("%c", look), "+", "-", NULL)){
emitln("push dword 0");
operator();
}
else if(isalpha(look)){
identifier();
}
else if(isdigit(look)){
emitln("mov eax, %s", getnumber());
}
else
expected("Number or variable");
}
开发者ID:16Bitt,项目名称:libcc,代码行数:51,代码来源:simple.c
示例20: setPagOptions
void DataFlowAnalysis::run(Program *program)
{
AnalyzerOptions *options = program->options;
bool verbose = options->verbose();
/* Set the PAG options as specified on the command line. */
setPagOptions(*options);
setPrefixedPagOptions(options, p_impl);
/* Build the program's ICFG if necessary. */
if (program->icfg == NULL)
program->icfg = createICFG(program, options);
/* Run this analysis. */
if (verbose)
{
std::cout
<< "performing analysis " << identifier() << " ... "
<< std::flush;
}
TimingPerformance *nestedTimer
= new TimingPerformance("Actual data-flow analysis "
+ identifier() + ":");
p_impl->analysisDoit(program->icfg);
delete nestedTimer;
if (verbose) std::cout << "done" << std::endl;
/* Make results persistent. We always do this (by default) to avoid
* problems with garbage collected results. */
p_impl->makePersistent();
#if HAVE_PAG
/* If requested, compute call strings from PAG's call string data, and
* store them in the ICFG. */
if (options->computeCallStrings())
computeCallStrings(program);
#endif
}
开发者ID:8l,项目名称:rose,代码行数:38,代码来源:satire_dataflow_analysis.C
注:本文中的identifier函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论