您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ what函数代码示例

51自学网 2021-06-03 09:55:53
  C++
这篇教程C++ what函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中what函数的典型用法代码示例。如果您正苦于以下问题:C++ what函数的具体用法?C++ what怎么用?C++ what使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了what函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: d_message

//----------------------------------------------------------------------------//Exception::Exception(const String& message, const String& name,                     const String& filename, int line, const String& function) :    d_message(message),    d_name(name),    d_filename(filename),    d_line(line),    d_function(function),    d_what(name + " in function '" + function +           "' (" + filename + ":" + PropertyHelper<int>::toString(line) + ") : " +           message){    // Log exception if possible    if (Logger* const logger = Logger::getSingletonPtr())    {        logger->logEvent(d_what, Errors);        dumpBacktrace(64);    }    if (d_stdErrEnabled)    {        // output to stderr unless it's explicitly disabled        // nobody seems to look in their log file!        std::cerr << what() << std::endl;    }#ifdef __ANDROID__    __android_log_print(ANDROID_LOG_ERROR, "CEGUIBase", "Exception thrown: %s", what());#endif}
开发者ID:Ketzer2002,项目名称:meridian59-engine,代码行数:29,


示例2: what

void win32_exception::writelog(const char *prefix)  const{  if( prefix )    CLog::Log(LOGERROR, "%s : %s (code:0x%08x) at 0x%08x", prefix, (unsigned int) what(), code(), where());  else    CLog::Log(LOGERROR, "%s (code:0x%08x) at 0x%08x", what(), code(), where());}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:7,


示例3: setType

QtException::QtException(ExceptionType exType,QString msg):exception(){    setType(exType);    setMessage(msg);    if(exType != ExceptionType::Information)        qCritical()<<getTypeAsString()<<"::"<<what();    else        qDebug()<<getTypeAsString()<<"::"<<what();}
开发者ID:young-developer,项目名称:enplayer,代码行数:9,


示例4: StartTrace

void GetThisHostNameRenderer::RenderAll(std::ostream &reply, Context &ctx, const ROAnything &config) {	StartTrace(GetThisHostNameRenderer.RenderAll);	String thisHostName;	if (coast::system::HostName(thisHostName)) {		String thisHostIp(Resolver::DNS2IPAddress(thisHostName));		String what(config["Representation"].AsString("Full"));		if ( what.IsEqual("IPAddress") ) {			reply << thisHostIp << std::flush;			return;		}		String thisHostDns(Resolver::IPAddress2DNS(thisHostIp));		thisHostDns.ToLower();		Trace("hostname [" << thisHostName << "] ip [" << thisHostIp << "] dns [" << thisHostDns << "]");		StringTokenizer tokens(thisHostDns, '.');		String hostName, domain;		if (tokens.NextToken(hostName)) {			domain = tokens.GetRemainder(false);		}		Trace("host [" << hostName << "] domain [" << domain << "]");		if (what.IsEqual("Full")) {			reply << thisHostDns;		} else if (what.IsEqual("HostOnly")) {			reply << hostName;		} else if (what.IsEqual("DomainOnly")) {			reply << domain;		}		reply << std::flush;	}}
开发者ID:chenbk85,项目名称:CuteTestForCoastTest,代码行数:29,


示例5: buildDefaultConfigLayer

RWConfig GameBase::buildConfig(const std::optional<RWArgConfigLayer> &args) {    RWConfig config;    if (args.has_value()) {        config.setLayer(RWConfig::LAYER_ARGUMENT, *args);    }    auto defaultLayer = buildDefaultConfigLayer();    config.setLayer(RWConfig::LAYER_DEFAULT, defaultLayer);    rwfs::path configPath;    if (args.has_value() && args->configPath.has_value()) {        configPath = *args->configPath;    } else {        configPath = RWConfigParser::getDefaultConfigPath() / "openrw.ini";    }    if ((!args) || (args && !args->noconfig)) {        RWConfigParser configParser{};        auto [configLayer, parseResult] = configParser.loadFile(configPath);        if (!parseResult.isValid()) {            log.error("Config", "Could not read configuation file at " + configPath.string());            throw std::runtime_error(parseResult.what());        }        config.unknown = parseResult.getUnknownData();        config.setLayer(RWConfig::LAYER_CONFIGFILE, configLayer);    }
开发者ID:rwengine,项目名称:openrw,代码行数:26,


示例6:

voidAssembler::Exception::print(std::ostream &o) const{    o <<what();    if (insn)        o <<" while assembling [" <<unparseInstruction(insn) <<"]";}
开发者ID:Federico2014,项目名称:edg4x-rose,代码行数:7,


示例7: do_log_msg

void RuntimeError::Log() const{	if( !m_logged )	{	    do_log_msg( LOG_PRIORITY_ERROR, m_category.c_str(), m_function.c_str(), what() );	}}
开发者ID:jgonzalezdr,项目名称:smartlib,代码行数:7,


示例8: asset

 bool InvalidAsset::CustomReport() const {     LogAlwaysError          << "Invalid asset (" << Initializer() << ") More information:"          << std::endl << what();     return true; }
开发者ID:ldh9451,项目名称:XLE,代码行数:7,


示例9: throw

/*** @param curEnv java environment where the exception occurred.*/JniCallMethodException::JniCallMethodException(JNIEnv * curEnv) throw() : JniException(curEnv){    std::string errorMessage = "Exception when calling Java method : ";    errorMessage += getJavaDescription() + "/n" + getJavaStackTrace();    errorMessage += what();    setErrorMessage(errorMessage);}
开发者ID:ZhanlinWang,项目名称:scilab,代码行数:10,


示例10: genCronTab

QueryData genCronTab() {  QueryData results;  auto system_lines = cronFromFile(kSystemCron);  for (const auto& line : system_lines) {    genCronLine(kSystemCron, line, results);  }  std::vector<std::string> user_crons;  auto status = listFilesInDirectory(kUserCronsPath, user_crons);  if (!status.ok()) {    LOG(ERROR) << "Could not list user crons from: " << kUserCronsPath << " ("               << status.what() << ")";    return results;  }  // The user-based crons are identified by their path.  for (const auto& user_path : user_crons) {    auto user_lines = cronFromFile(user_path);    for (const auto& line : user_lines) {      genCronLine(user_path, line, results);    }  }  return results;}
开发者ID:Creepig01,项目名称:osquery,代码行数:26,


示例11: wxCHECK_RET

void wxLuaConsole::DisplayStack(const wxLuaState& wxlState){    wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState"));    int       nIndex   = 0;    lua_Debug luaDebug = INIT_LUA_DEBUG;    wxString  buffer;    lua_State* L = wxlState.GetLuaState();    while (lua_getstack(L, nIndex, &luaDebug) != 0)    {        if (lua_getinfo(L, "Sln", &luaDebug))        {            wxString what    (luaDebug.what     ? lua2wx(luaDebug.what)     : wxString(wxT("?")));            wxString nameWhat(luaDebug.namewhat ? lua2wx(luaDebug.namewhat) : wxString(wxT("?")));            wxString name    (luaDebug.name     ? lua2wx(luaDebug.name)     : wxString(wxT("?")));            buffer += wxString::Format(wxT("[%d] %s '%s' '%s' (line %d)/n    Line %d src='%s'/n"),                                       nIndex, what.c_str(), nameWhat.c_str(), name.c_str(), luaDebug.linedefined,                                       luaDebug.currentline, lua2wx(luaDebug.short_src).c_str());        }        nIndex++;    }    if (!buffer.empty())    {        AppendText(wxT("/n-----------------------------------------------------------")                   wxT("/n- Backtrace")                   wxT("/n-----------------------------------------------------------/n") +                   buffer +                   wxT("/n-----------------------------------------------------------/n/n"));    }}
开发者ID:mattprintz,项目名称:wx-xword,代码行数:33,


示例12: SERIALIZE_CALL_RECUR

	std::string 	_nimble_exception::to_string(		__in_opt bool verbose		)	{		std::stringstream result;		SERIALIZE_CALL_RECUR(m_lock);		result << what();#ifndef NDEBUG		if(verbose) {			SET_TERM_ATTRIB(result, 1, COL_FORE_YELLOW);			result << " (";			if(!m_source.empty()) {				result << m_source << ":";			}			result << m_line << ") ";			CLEAR_TERM_ATTRIB(result);		}#else		REF_PARAM(verbose);#endif		return CHK_STR(result.str());	}
开发者ID:majestic53old,项目名称:libnimble,代码行数:29,


示例13: onelab_option_cb

void onelab_option_cb(Fl_Widget *w, void *data){  if(!data) return;  std::string what((const char*)data);  double val = ((Fl_Menu_*)w)->mvalue()->value() ? 1. : 0.;  if(what == "save")    CTX::instance()->solver.autoSaveDatabase = val;  else if(what == "archive")    CTX::instance()->solver.autoArchiveOutputFiles = val;  else if(what == "check"){    CTX::instance()->solver.autoCheck = val;    FlGui::instance()->onelab->setButtonVisibility();  }  else if(what == "mesh")    CTX::instance()->solver.autoMesh = val;  else if(what == "merge")    CTX::instance()->solver.autoMergeFile = val;  else if(what == "show")    CTX::instance()->solver.autoShowViews = val ? 2 : 0;  else if(what == "step")    CTX::instance()->solver.autoShowLastStep = val;  else if(what == "invisible"){    CTX::instance()->solver.showInvisibleParameters = val;    //FlGui::instance()->onelab->rebuildTree(true);  }}
开发者ID:kevinr2763,项目名称:gmsh,代码行数:26,


示例14: my_where_msg

basic_warning::basic_warning(const std::string& where_msg,		const std::string& what_msg, type t) :	my_where_msg(where_msg), my_what_msg(what_msg), my_type(t) {	if (warning_stream) {		std::string msg = what();		if (msg != "") {			// @todo This should be handled by passing the logger as			// a stream (with some appropriate wrapper deriving from basic_ostream)			// but for now this will have to do.			if (is_active()) {				// add warning to counter				if (warning_count.find(t)==warning_count.end())					warning_count[t]=1;				else					++warning_count[t];				// output message				if (warning_stream != logger::get_stream()) {					*warning_stream << msg << std::endl;				} else {					// to avoid interleaving with logged messages, send					// a logged message					logger(logger_level::ALWAYS, where_msg,							"WARNING (" + type_msg(t) + ") " + my_what_msg);				}			}		}	}}
开发者ID:selyunin,项目名称:spcx-src,代码行数:29,


示例15: what

void Parser::parsingException::searchError(std::string line, int nbLine) const{    std::string error;        error = "Line " + std::to_string(nbLine) + " : " + line + " : " + what();    _errorList->push_back(error);}
开发者ID:ClementBarbisan,项目名称:abstract_vm,代码行数:7,


示例16: out_lock

		int server_streambuf::flush(bool end) {			std::error_code e;			// wait for previous responses in the pipeline to complete:			{				std::unique_lock<std::mutex> out_lock(act_mutex);				while (!active)					act_cond.wait(out_lock);			}			// flush headers if not already written:			if (!hdrs_written) {				size_t content_len;				if (!query_headers_content_length(out_hdrs, content_len)) {					chunked = true;#ifdef CLANE_HAVE_STD_MULTIMAP_EMPLACE					out_hdrs.emplace("transfer-encoding", "chunked");#else					out_hdrs.insert(header("transfer-encoding", "chunked"));#endif				}				std::ostringstream ss;				ss << "HTTP/" << major_ver << '.' << minor_ver << ' ' << static_cast<int>(out_stat_code) << ' ' <<				 	what(out_stat_code) << "/r/n";				for (auto i = out_hdrs.begin(); i != out_hdrs.end(); ++i)					ss << canonize_1x_header_name(i->first) << ": " << i->second << "/r/n";				ss << "/r/n";				std::string hdr_lines = ss.str();				sock.send(hdr_lines.data(), hdr_lines.size(), net::all, e);				if (e)					return -1; // connection error				hdrs_written = true;			}			// send:			size_t chunk_len = pptr() - pbase();			if (chunk_len) {				if (chunked) {					std::ostringstream ss;					ss << std::hex << chunk_len << "/r/n";					std::string chunk_line = ss.str();					sock.send(chunk_line.data(), chunk_line.size(), net::all, e);					if (e)						return -1; // connection error				}				sock.send(pbase(), chunk_len, net::all, e);				if (e)					return -1; // connection error				if (chunked) {					sock.send("/r/n", 2, net::all, e);					if (e)						return -1; // connection error				}			}			// final chunk:			if (end && chunked) {				sock.send("0/r/n/r/n", 5, net::all, e);				if (e)					return -1; // connection error			}			return 0; // success		}
开发者ID:cmbrandenburg,项目名称:clane,代码行数:59,


示例17: newmode

static mode_tnewmode(const char *ms, const mode_t pm){	register mode_t	o, m, b;	int	lock, setsgid = 0, cleared = 0, copy = 0;	mode_t	nm, om, mm;	nm = om = pm;	m = absol(&ms);	if (!*ms) {		nm = m;		goto out;	}	if ((lock = (nm&S_IFMT) != S_IFDIR && (nm&(S_ENFMT|S_IXGRP)) == S_ENFMT)			== 01)		nm &= ~(mode_t)S_ENFMT;	do {		m = who(&ms, &mm);		while (o = what(&ms)) {			b = where(&ms, nm, &lock, &copy, pm);			switch (o) {			case '+':				nm |= b & m & ~mm;				if (b & S_ISGID)					setsgid = 1;				if (lock & 04)					lock |= 02;				break;			case '-':				nm &= ~(b & m & ~mm);				if (b & S_ISGID)					setsgid = 1;				if (lock & 04)					lock = 0;				break;			case '=':				nm &= ~m;				nm |= b & m & ~mm;				lock &= ~01;				if (lock & 04)					lock |= 02;				om = 0;				if (copy == 0)					cleared = 1;				break;			}			lock &= ~04;		}	} while (*ms++ == ',');	if (*--ms)		failed(&badumask[4], badumask);out:	if (pm & S_IFDIR) {		if ((pm & S_ISGID) && setsgid == 0)			nm |= S_ISGID;		else if ((nm & S_ISGID) && setsgid == 0)			nm &= ~(mode_t)S_ISGID;	}	return(nm);}
开发者ID:Sunshine-OS,项目名称:heirloom-sh,代码行数:59,


示例18: what

void WebListBox::NotifySelectChange(void){	if (mpListener)	{		NotifyEvent what(NOTIFIER_TYPE_LIST_BOX, NOTIFY_SELECT_CHANGE);		mpListener->Notify((WebListBox*)this, &what);	}}
开发者ID:peteratebs,项目名称:webcwebbrowser,代码行数:8,


示例19: LOG

void win32_exception::LogThrowMessage(const char *prefix)  const{  if( prefix )    LOG(LOGERROR, "Unhandled exception in %s : %s (code:0x%08x) at 0x%08x", prefix, (unsigned int) what(), code(), where());  else    LOG(LOGERROR, "Unhandled exception in %s (code:0x%08x) at 0x%08x", what(), code(), where());  write_minidump();}
开发者ID:OV3RDOSE,项目名称:xbmc,代码行数:8,


示例20: what

 void SDLError::outputFormattedMessage(std::ostream& os)noexcept{   os << what()      << " : " << sdlErrorMessage() << "/n"      << " at " << functionName()      << " in " << fileName()      << " line " << lineNumber()      << std::endl; }
开发者ID:hatsusato,项目名称:PenroseTiling,代码行数:8,


示例21: whatString

	std::wstring GameException::whatw() const	{		std::string whatString(what());		std::wstring whatw;		whatw.assign(whatString.begin(), whatString.end());		return whatw;	}
开发者ID:cribsb,项目名称:BEngine,代码行数:8,


示例22: throw

string Exception::getDiagnosticInformation() const throw(){    string out = "exception: ";    out += what();    if (file())        return out + " (throw from " + file() + ":"+ boost::lexical_cast<string>(line()) + ")";    return out;}
开发者ID:haoustc,项目名称:server1,代码行数:8,


示例23: launchQuery

void launchQuery(const std::string& name, const ScheduledQuery& query) {  // Execute the scheduled query and create a named query object.  VLOG(1) << "Executing query: " << query.query;  auto sql = (FLAGS_enable_monitor) ? monitor(name, query) : SQL(query.query);  if (!sql.ok()) {    LOG(ERROR) << "Error executing query (" << query.query               << "): " << sql.getMessageString();    return;  }  // Fill in a host identifier fields based on configuration or availability.  std::string ident;  auto status = getHostIdentifier(ident);  if (!status.ok() || ident.empty()) {    ident = "<unknown>";  }  // A query log item contains an optional set of differential results or  // a copy of the most-recent execution alongside some query metadata.  QueryLogItem item;  item.name = name;  item.identifier = ident;  item.time = osquery::getUnixTime();  item.calendar_time = osquery::getAsciiTime();  if (query.options.count("snapshot") && query.options.at("snapshot")) {    // This is a snapshot query, emit results with a differential or state.    item.snapshot_results = std::move(sql.rows());    logSnapshotQuery(item);    return;  }  // Create a database-backed set of query results.  auto dbQuery = Query(name, query);  DiffResults diff_results;  // Add this execution's set of results to the database-tracked named query.  // We can then ask for a differential from the last time this named query  // was executed by exact matching each row.  status = dbQuery.addNewResults(sql.rows(), diff_results);  if (!status.ok()) {    LOG(ERROR) << "Error adding new results to database: " << status.what();    return;  }  if (diff_results.added.size() == 0 && diff_results.removed.size() == 0) {    // No diff results or events to emit.    return;  }  VLOG(1) << "Found results for query (" << name << ") for host: " << ident;  item.results = diff_results;  status = logQueryLogItem(item);  if (!status.ok()) {    LOG(ERROR) << "Error logging the results of query (" << query.query               << "): " << status.toString();  }}
开发者ID:aayn,项目名称:osquery,代码行数:58,


示例24: main

int main() {  int stack = 10;  int* heap = malloc(sizeof(int));  printf("data = %p, stack = %p, lib = %p, heap = %p/n", &data, &stack, what(), heap);  return 0;}
开发者ID:edmcman,项目名称:aslr-test,代码行数:9,


示例25: mir_a2t

void CRTException::display() const{	TCHAR *tszMsg = mir_a2t(what());	TCHAR tszBoxMsg[500];	mir_sntprintf(tszBoxMsg, _T("%s/n/n(%s)"), tszMsg, m_szParam);	::MessageBox(0, tszBoxMsg, _T("Clist_nicer runtime error"), MB_OK | MB_ICONERROR);	mir_free(tszMsg);}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:9,


示例26: Throw

// Asserts that the filename is clean for portability.// That means the function does nothing if the filename is// portable, and throws ex::Invalid if its not.void File::assertClean() {    /* TODO       if( !fs::portable_file_name( m_name.filename().string() ))       Throw(ex::Invalid,"File Name",m_name.filename().string());       */    Node::assertClean();    if(exists() && what() != FILE)        Throw(ex::Not,"File",m_name.string());}
开发者ID:FrozenHelium,项目名称:potato-download-manager,代码行数:12,


示例27: get_all_messages

 std::vector<std::string> get_all_messages() const {     if (exceptions_.empty()) {         std::vector<std::string> msgs;         msgs.push_back(what());         return msgs;     }     return detail::get_all_messages(exceptions_); }
开发者ID:saga-project,项目名称:saga-cpp,代码行数:9,



注:本文中的what函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ what_function_value函数代码示例
C++ wglSwapIntervalEXT函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。