本文整理汇总了C++中identifier函数的典型用法代码示例。如果您正苦于以下问题:C++ identifier函数的具体用法?C++ identifier怎么用?C++ identifier使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了identifier函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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));
}
示例3: CommandResult
CommandResult::SharedConst TotalBalancesCommand::resultOk(
string &totalBalancesStr) const
{
return CommandResult::SharedConst(
new CommandResult(
identifier(),
UUID(),
200,
totalBalancesStr));
}
示例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, ());
}
示例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));
}
示例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;
}
}
示例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());
}
示例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);
}
示例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();
}
}
示例11: forcedHit
void Brick::forcedHit()
{
if (m_deleted) return;
if (identifier() == "ExplodingBrick") {
explode();
} else {
handleDeletion();
}
hide();
}
示例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 );
}
}
示例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__);
}
}
示例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();
}
示例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;
}