这篇教程C++ stdstr函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中stdstr函数的典型用法代码示例。如果您正苦于以下问题:C++ stdstr函数的具体用法?C++ stdstr怎么用?C++ stdstr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了stdstr函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: strlensigned char TreeKeyIdx::create(const char *ipath) { char *path = 0; char *buf = new char [ strlen (ipath) + 20 ]; FileDesc *fd, *fd2; stdstr(&path, ipath); if ((path[strlen(path)-1] == '/') || (path[strlen(path)-1] == '//')) path[strlen(path)-1] = 0; sprintf(buf, "%s.dat", path); FileMgr::removeFile(buf); fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE); fd->getFd(); FileMgr::getSystemFileMgr()->close(fd); sprintf(buf, "%s.idx", path); FileMgr::removeFile(buf); fd2 = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE); fd2->getFd(); FileMgr::getSystemFileMgr()->close(fd2); TreeKeyIdx newTree(path); TreeKeyIdx::TreeNode root; stdstr(&(root.name), ""); newTree.saveTreeNode(&root); delete [] path; return 0;}
开发者ID:bluehavana,项目名称:sword,代码行数:31,
示例2: SWConfigSWLocale::SWLocale(const char *ifilename) { p = new Private; ConfigEntMap::iterator confEntry; name = 0; description = 0; encoding = 0; bookAbbrevs = 0; bookLongNames = 0; bookPrefAbbrev = 0; if (ifilename) { localeSource = new SWConfig(ifilename); } else { localeSource = new SWConfig(0); (*localeSource)["Meta"]["Name"] = DEFAULT_LOCALE_NAME; (*localeSource)["Meta"]["Description"] = "English (US)"; bookAbbrevs = (struct abbrev *)builtin_abbrevs; for (abbrevsCnt = 0; builtin_abbrevs[abbrevsCnt].osis[0]; abbrevsCnt++); } confEntry = localeSource->Sections["Meta"].find("Name"); if (confEntry != localeSource->Sections["Meta"].end()) stdstr(&name, (*confEntry).second.c_str()); confEntry = localeSource->Sections["Meta"].find("Description"); if (confEntry != localeSource->Sections["Meta"].end()) stdstr(&description, (*confEntry).second.c_str()); confEntry = localeSource->Sections["Meta"].find("Encoding"); //Either empty (==Latin1) or UTF-8 if (confEntry != localeSource->Sections["Meta"].end()) stdstr(&encoding, (*confEntry).second.c_str());}
开发者ID:kalemas,项目名称:sword,代码行数:33,
示例3: cachepathTxTexCache::~TxTexCache(){#if DUMP_CACHE if (_options & DUMP_TEXCACHE) { /* dump cache to disk */ std::wstring filename = _ident + L"_MEMORYCACHE.dat"; CPath cachepath(stdstr().FromUTF16(_path.c_str()).c_str(),""); cachepath.AppendDirectory("cache"); int config = _options & (FILTER_MASK|ENHANCEMENT_MASK|COMPRESS_TEX|COMPRESSION_MASK|FORCE16BPP_TEX|GZ_TEXCACHE); TxCache::save(stdstr((std::string &)cachepath).ToUTF16().c_str(), filename.c_str(), config); }#endif}
开发者ID:jmarroyo90,项目名称:project64,代码行数:15,
示例4: handleNumericEscapeStringbool SWBasicFilter::substituteEscapeString(std::string &buf, const char *escString) { DualStringMap::iterator it; if (*escString == '#') { return handleNumericEscapeString(buf, escString); } if (passAllowedEscapeString(buf, escString)) { return true; } if (!escStringCaseSensitive) { char *tmp = 0; stdstr(&tmp, escString); toupperstr(tmp); it = p->escSubMap.find(tmp); delete [] tmp; } else it = p->escSubMap.find(escString); if (it != p->escSubMap.end()) { buf += it->second.c_str(); return true; } return false;}
开发者ID:kalemas,项目名称:swordxx,代码行数:26,
示例5: strlenchar RawLD::getEntry(long away) const{ uint32_t start = 0; uint16_t size = 0; char *idxbuf = 0; char retval = 0; char *buf = new char [ strlen(*key) + 6 ]; strcpy(buf, *key); if (strongsPadding) strongsPad(buf); if (!(retval = findOffset(buf, &start, &size, away))) { readText(start, &size, &idxbuf, entryBuf); rawFilter(entryBuf, 0); // hack, decipher rawFilter(entryBuf, key); entrySize = size; // support getEntrySize call if (!key->isPersist()) // If we have our own key *key = idxbuf; // reset it to entry index buffer stdstr(&entkeytxt, idxbuf); // set entry key text that module 'snapped' to. delete [] idxbuf; } else { entryBuf = ""; } delete [] buf; return retval;}
开发者ID:kalemas,项目名称:swordxx,代码行数:30,
示例6: sizeofRawVerse::RawVerse(const char *ipath, int fileMode){ std::string buf; buf.reserve(std::strlen(ipath) + sizeof("/ot.vss")); path = 0; stdstr(&path, ipath); buf = path; addTrailingDirectorySlash(buf); if (fileMode == -1) { // try read/write if possible fileMode = FileMgr::RDWR; } buf.append("ot.vss"); auto const it(buf.rbegin() + 5u); idxfp[0] = FileMgr::getSystemFileMgr()->open(buf.c_str(), fileMode, true); (*it) = 'n'; idxfp[1] = FileMgr::getSystemFileMgr()->open(buf.c_str(), fileMode, true); buf.resize(buf.size() - 4u); textfp[1] = FileMgr::getSystemFileMgr()->open(buf.c_str(), fileMode, true); (*it) = 'o'; textfp[0] = FileMgr::getSystemFileMgr()->open(buf.c_str(), fileMode, true); instance++;}
开发者ID:kalemas,项目名称:swordxx,代码行数:30,
示例7: stdstrvoid TreeKeyIdx::setText(const char *ikey) { char *buf = 0; stdstr(&buf, ikey); SWBuf leaf = strtok(buf, "/"); leaf.trim(); root(); while ((leaf.size()) && (!popError())) { bool ok, inChild = false; error = KEYERR_OUTOFBOUNDS; for (ok = firstChild(); ok; ok = nextSibling()) { inChild = true; if (leaf == getLocalName()) { error = 0; break; } } leaf = strtok(0, "/"); leaf.trim(); if (!ok) { if (inChild) { // if we didn't find a matching child node, default to first child parent(); firstChild(); } error = KEYERR_OUTOFBOUNDS; } } if (leaf.size()) error = KEYERR_OUTOFBOUNDS; delete [] buf; unsnappedKeyText = ikey; positionChanged();}
开发者ID:bluehavana,项目名称:sword,代码行数:32,
示例8: SWGenBookSWORD_NAMESPACE_START/****************************************************************************** * RawGenBook Constructor - Initializes data for instance of RawGenBook * * ENT: iname - Internal name for module * idesc - Name to display to user for module * idisp - Display object to use for displaying */RawGenBook::RawGenBook(const char *ipath, const char *iname, const char *idesc, SWDisplay *idisp, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, const char* ilang, const char *keyType) : SWGenBook(iname, idesc, idisp, enc, dir, mark, ilang) { char *buf = new char [ strlen (ipath) + 20 ]; path = 0; stdstr(&path, ipath); verseKey = !strcmp("VerseKey", keyType); if (verseKey) setType("Biblical Texts"); if ((path[strlen(path)-1] == '/') || (path[strlen(path)-1] == '//')) path[strlen(path)-1] = 0; delete key; key = createKey(); sprintf(buf, "%s.bdt", path); bdtfd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::RDWR, true); delete [] buf;}
开发者ID:bluehavana,项目名称:sword,代码行数:34,
示例9: getQIcon* get( NamedSymbol* ns ){ Parameter* opts = get_options( ns ); Locator* l = get_locator( ns ); int gt = get_grist_type( ns ); opts = find_by_hash( opts, hashlittle( "cts" ) ); opts = find_child_by_hash( opts, hashlittle( "icon" ) ); if( opts && !safe_to_convert( opts, E_VART_STRING ) ) opts = 0x0; QIcon* icon = 0x0; if( opts ) { QFileInfo fi( l->m_Buffer ); QDir parent_dir( fi.absoluteDir() ); QString qstr = parent_dir.absoluteFilePath( QString( as_string( *opts )->m_Raw ) ); std::string stdstr( qstr.toStdString() ); icon = get( stdstr.c_str() ); } if( !icon ) icon = get( g_NodeSVGResourcePaths[gt] ); return icon;}
开发者ID:AntonioModer,项目名称:calltree,代码行数:27,
示例10: strlensigned char RawStr::createModule(const char *ipath){ char *path = 0; char *buf = new char [ strlen (ipath) + 20 ]; FileDesc *fd, *fd2; stdstr(&path, ipath); if ((path[strlen(path)-1] == '/') || (path[strlen(path)-1] == '//')) path[strlen(path)-1] = 0; sprintf(buf, "%s.dat", path); FileMgr::removeFile(buf); fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE); fd->getFd(); FileMgr::getSystemFileMgr()->close(fd); sprintf(buf, "%s.idx", path); FileMgr::removeFile(buf); fd2 = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE); fd2->getFd(); FileMgr::getSystemFileMgr()->close(fd2); delete [] path; return 0;}
开发者ID:bluehavana,项目名称:sword,代码行数:27,
示例11: stdstrRawVerse::RawVerse(const char *ipath, int fileMode){ SWBuf buf; path = 0; stdstr(&path, ipath); if ((path[strlen(path)-1] == '/') || (path[strlen(path)-1] == '//')) path[strlen(path)-1] = 0; if (fileMode == -1) { // try read/write if possible fileMode = FileMgr::RDWR; } buf.setFormatted("%s/ot.vss", path); idxfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode, true); buf.setFormatted("%s/nt.vss", path); idxfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode, true); buf.setFormatted("%s/ot", path); textfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode, true); buf.setFormatted("%s/nt", path); textfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode, true); instance++;}
开发者ID:bluehavana,项目名称:sword,代码行数:28,
示例12: timevoid CNotificationImp::DisplayMessage(int DisplayTime, const char * Message) const{ if (!m_hWnd) { return; } if (m_NextMsg > 0 || DisplayTime > 0) { time_t Now = time(NULL); if (DisplayTime == 0 && Now < m_NextMsg) { return; } if (DisplayTime > 0) { m_NextMsg = Now + DisplayTime; } if (m_NextMsg == 0) { m_NextMsg = 0; } } if (InFullScreen()) { if (m_gfxPlugin && m_gfxPlugin->DrawStatus) { WriteTrace(TraceGFXPlugin, TraceDebug, "DrawStatus - Starting"); m_gfxPlugin->DrawStatus(Message, FALSE); WriteTrace(TraceGFXPlugin, TraceDebug, "DrawStatus - Done"); } } else { m_hWnd->SetStatusText(0, stdstr(Message).ToUTF16().c_str()); }}
开发者ID:andrewservania,项目名称:project64,代码行数:35,
示例13: SWModuleSWText::SWText(const char *imodname, const char *imoddesc, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, const char* ilang, const char *versification): SWModule(staticCreateKey(versification), imodname, imoddesc, "Biblical Texts", enc, dir, mark, ilang) { this->versification = 0; stdstr(&(this->versification), versification); tmpVK1 = (VerseKey *)createKey(); tmpVK2 = (VerseKey *)createKey(); tmpSecond = false; skipConsecutiveLinks = false;}
开发者ID:kalemas,项目名称:swordxx,代码行数:8,
示例14: stdstrvoid TreeKey::assureKeyPath(const char *keyBuffer) { if (!keyBuffer) { keyBuffer = unsnappedKeyText; //assert we have something to do before setting root if (!*keyBuffer) return; } char *keybuf = 0; stdstr(&keybuf, keyBuffer); root(); // TODO: change to NOT use strtok. strtok is dangerous. SWBuf tok = strtok(keybuf, "/"); tok.trim(); while (tok.size()) { bool foundkey = false; if (hasChildren()) { firstChild(); if (tok == getLocalName()) { foundkey = true; } else { while (nextSibling()) { if (getLocalName()) { if (tok == getLocalName()) { foundkey = true; break; } } } } if (!foundkey) { append(); setLocalName(tok); save(); } } else { appendChild(); setLocalName(tok); save(); }#ifdef DEBUG// std::cout << getLocalName() << " : " << tok << std::endl;#endif tok = strtok(0, "/"); tok.trim(); } delete [] keybuf;}
开发者ID:Jaden-J,项目名称:osstudybible,代码行数:56,
示例15: WriteTracevoid CNotificationImp::FatalError(const char * Message) const{ WriteTrace(TraceUserInterface, TraceError, Message); WindowMode(); HWND Parent = NULL; if (m_hWnd) { Parent = reinterpret_cast<HWND>(m_hWnd->GetWindowHandle()); } MessageBoxW(Parent, stdstr(Message).ToUTF16().c_str(), L"Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND); ExitThread(0);}
开发者ID:andrewservania,项目名称:project64,代码行数:10,
示例16: screen_msg/* ---------------------------------------------------------------------- */void PHRQ_io::screen_msg(const char * str)/* ---------------------------------------------------------------------- */{ std::string stdstr(str); if (error_file != NULL && screen_on) { fprintf(error_file, "%s", str); }}
开发者ID:cran,项目名称:phreeqc,代码行数:11,
示例17: stdstrvoid SWBasicFilter::addEscapeStringSubstitute(const char *findString, const char *replaceString) { char *buf = 0; if (!escStringCaseSensitive) { stdstr(&buf, findString); toupperstr(buf); p->escSubMap.insert(DualStringMap::value_type(buf, replaceString)); delete [] buf; } else p->escSubMap.insert(DualStringMap::value_type(findString, replaceString));}
开发者ID:kalemas,项目名称:swordxx,代码行数:11,
示例18: TxCacheTxTexCache::TxTexCache(int options, int cachesize, const wchar_t *path, const wchar_t *ident, dispInfoFuncExt callback ) : TxCache((options & ~GZ_HIRESTEXCACHE), cachesize, path, ident, callback){ /* assert local options */ if (_path.empty() || _ident.empty() || !_cacheSize) _options &= ~DUMP_TEXCACHE;#if DUMP_CACHE if (_options & DUMP_TEXCACHE) { /* find it on disk */ std::wstring filename = _ident + L"_MEMORYCACHE.dat"; CPath cachepath(stdstr().FromUTF16(_path.c_str()),""); cachepath.AppendDirectory("cache"); int config = _options & (FILTER_MASK|ENHANCEMENT_MASK|COMPRESS_TEX|COMPRESSION_MASK|FORCE16BPP_TEX|GZ_TEXCACHE); TxCache::load(stdstr((std::string &)cachepath).ToUTF16().c_str(), filename.c_str(), config); }#endif}
开发者ID:jmarroyo90,项目名称:project64,代码行数:20,
示例19: _splitpathvoid CPlugins::CreatePluginDir ( const stdstr & DstDir ) const { char path_buffer[_MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; _splitpath(DstDir.c_str(), drive, dir, fname, ext ); _makepath(path_buffer, drive, dir, "", "" ); if (CreateDirectory(path_buffer,NULL) == 0 && GetLastError() == ERROR_PATH_NOT_FOUND) { path_buffer[strlen(path_buffer) - 1] = 0; CreatePluginDir(stdstr(path_buffer)); CreateDirectory(path_buffer,NULL); }}
开发者ID:aschwant,项目名称:project64,代码行数:12,
示例20: strcatconst char *ListKey::getOSISRefRangeText() const { char *buf = new char[(arraycnt + 1) * 255]; buf[0] = 0; for (int i = 0; i < arraycnt; i++) { strcat(buf, array[i]->getOSISRefRangeText()); if (i < arraycnt-1) strcat(buf, ";"); } stdstr(&rangeText, buf); delete [] buf; return rangeText;}
开发者ID:dsalunga,项目名称:mcgi-bible-ios,代码行数:12,
示例21: stdstrvoid LocaleMgr::setDefaultLocaleName(const char *name) { char *tmplang=0; stdstr(&tmplang, name); // discard everything after '.' usually encoding e.g. .UTF-8 strtok(tmplang, "."); // also discard after '@' so e.g. @euro locales are found strtok(tmplang, "@"); stdstr(&defaultLocaleName, tmplang); // First check for what we ask for if (!getLocale(tmplang)) { // check for locale without country char *nocntry=0; stdstr(&nocntry, tmplang); strtok(nocntry, "_"); if (getLocale(nocntry)) { stdstr(&defaultLocaleName, nocntry); } delete [] nocntry; } delete [] tmplang;}
开发者ID:Jaden-J,项目名称:osstudybible,代码行数:23,
示例22: initSWMgr::SWMgr(const char *iConfigPath, bool autoload, SWFilterMgr *filterMgr, bool multiMod, bool augmentHome) { init(); mgrModeMultiMod = multiMod; SWBuf path; this->filterMgr = filterMgr; if (filterMgr) filterMgr->setParentMgr(this); this->augmentHome = augmentHome; path = iConfigPath; int len = path.length(); if ((len < 1) || ((iConfigPath[len-1] != '//') && (iConfigPath[len-1] != '/'))) path += "/"; if (FileMgr::existsFile(path.c_str(), "mods.conf")) { stdstr(&prefixPath, path.c_str()); path += "mods.conf"; stdstr(&configPath, path.c_str()); } else { if (FileMgr::existsDir(path.c_str(), "mods.d")) { stdstr(&prefixPath, path.c_str()); path += "mods.d"; stdstr(&configPath, path.c_str()); configType = 1; } } config = 0; sysConfig = 0; if (autoload && configPath) Load();}
开发者ID:raphink,项目名称:sword,代码行数:37,
注:本文中的stdstr函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ stell函数代码示例 C++ stdio_serial_init函数代码示例 |