这篇教程C++ Ctxt函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Ctxt函数的典型用法代码示例。如果您正苦于以下问题:C++ Ctxt函数的具体用法?C++ Ctxt怎么用?C++ Ctxt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Ctxt函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: whilevoid sys::File::readInto(char *buffer, Size_T size){ static const size_t MAX_READ_SIZE = std::numeric_limits<DWORD>::max(); size_t bytesRead = 0; size_t bytesRemaining = size; while (bytesRead < size) { // Determine how many bytes to read const DWORD bytesToRead = static_cast<DWORD>( std::min(MAX_READ_SIZE, bytesRemaining)); // Read from file DWORD bytesThisRead = 0; if (!ReadFile(mHandle, buffer + bytesRead, bytesToRead, &bytesThisRead, NULL)) { throw sys::SystemException(Ctxt("Error reading from file")); } else if (bytesThisRead == 0) { //! ReadFile does not fail when finding the EOF -- // instead it reports 0 bytes read, so this stops an infinite loop // from Unexpected EOF throw sys::SystemException(Ctxt("Unexpected end of file")); } bytesRead += bytesThisRead; bytesRemaining -= bytesThisRead; }}
开发者ID:ngageoint,项目名称:six-library,代码行数:34,
示例2: whiledouble Utilities::remapZeroTo360(double degree){ double delta = degree; while (delta < 0.) { delta += 360.; if (degree == delta) { throw except::Exception(Ctxt( "Value [" + str::toString(degree) + "] is too small to remap into the [0:360] range")); } } while (delta > 360.) { delta -= 360.; if (degree == delta) { throw except::Exception(Ctxt( "Value [" + str::toString(degree) + "] is too large to remap into the [0:360] range")); } } return delta;}
开发者ID:ngageoint,项目名称:six-library,代码行数:25,
示例3: catchvoid mt::ThreadGroup::joinAll(){ bool failed = false; // Keep track of which threads we've already joined. for (; mLastJoined < mThreads.size(); mLastJoined++) { try { mThreads[mLastJoined]->join(); } catch (...) { failed = true; } } if (!mExceptions.empty()) { std::string messageString("Exceptions thrown from ThreadGroup in the following order:/n"); for (size_t ii=0; ii<mExceptions.size(); ++ii) { messageString += mExceptions.at(ii).toString(); } throw except::Exception(Ctxt(messageString)); } if (failed) throw except::Error(Ctxt("ThreadGroup could not be joined"));}
开发者ID:adam-beauchamp,项目名称:coda-oss,代码行数:29,
示例4: Exceptionconst ScratchMemory::Segment& ScratchMemory::lookupSegment( const std::string& key, size_t indexBuffer) const{ if (mBuffer.data == NULL) { std::ostringstream oss; oss << "Tried to get scratch memory for /"" << key << "/" before running setup."; throw except::Exception(Ctxt(oss.str())); } std::map<std::string, Segment>::const_iterator iterSeg = mSegments.find(key); if (iterSeg == mSegments.end()) { std::ostringstream oss; oss << "Scratch memory segment was not found for /"" << key << "/""; throw except::Exception(Ctxt(oss.str())); } const Segment& segment = iterSeg->second; if (indexBuffer >= segment.buffers.size()) { std::ostringstream oss; oss << "Trying to get buffer index " << indexBuffer << " for /"" << key << "/", which has only " << segment.buffers.size() << " buffers"; throw except::Exception(Ctxt(oss.str())); } return segment;}
开发者ID:mdaus,项目名称:nitro,代码行数:31,
示例5: getSideOfTrackstd::auto_ptr<scene::ProjectionModel>Utilities::getProjectionModel(const DerivedData* data){ const int lookDir = getSideOfTrack(data); scene::Errors errors; ::getErrors(*data, errors); std::auto_ptr<scene::SceneGeometry> geom(getSceneGeometry(data)); const six::ProjectionType gridType = data->measurement->projection->projectionType; std::auto_ptr<scene::ProjectionModel> projModel; switch (gridType) { case six::ProjectionType::PLANE: { const six::sidd::PlaneProjection* const plane = reinterpret_cast<six::sidd::PlaneProjection*>( data->measurement->projection.get()); projModel.reset(new scene::PlaneProjectionModel( geom->getSlantPlaneZ(), plane->productPlane.rowUnitVector, plane->productPlane.colUnitVector, plane->referencePoint.ecef, data->measurement->arpPoly, plane->timeCOAPoly, lookDir, errors)); break; } case six::ProjectionType::GEOGRAPHIC: { const six::sidd::MeasurableProjection* const geo = reinterpret_cast<six::sidd::MeasurableProjection*>( data->measurement->projection.get()); projModel.reset(new scene::GeodeticProjectionModel( geom->getSlantPlaneZ(), geo->referencePoint.ecef, data->measurement->arpPoly, geo->timeCOAPoly, lookDir, errors)); break; } case six::ProjectionType::POLYNOMIAL: case six::ProjectionType::CYLINDRICAL: case six::ProjectionType::NOT_SET: throw except::Exception(Ctxt("Grid type not supported: " + gridType.toString())); default: throw except::Exception(Ctxt("Invalid grid type: " + gridType.toString())); } return projModel;}
开发者ID:BSteine,项目名称:six-library,代码行数:59,
示例6: thrownitf::Pair nitf::HashTable::find(const std::string& key) throw(except::NoSuchKeyException){ if (key.length() == 0) throw except::NoSuchKeyException(Ctxt("Empty key value")); nitf_Pair* x = nitf_HashTable_find(getNative(), key.c_str()); if (!x) throw except::NoSuchKeyException(Ctxt(key)); return nitf::Pair(x);}
开发者ID:aivaras16,项目名称:nitro,代码行数:9,
示例7: definedvoid net::ssl::SSLConnectionClientFactory::initializeContext(){#if defined(USE_OPENSSL) SSL_library_init(); SSL_load_error_strings();#if defined(OPENSSL_0_9_8) SSL_METHOD *method = SSLv23_client_method();#else const SSL_METHOD *method = SSLv23_client_method();#endif if(method == NULL) { throw net::ssl::SSLException(Ctxt(FmtX("SSLv23_client_method failed"))); } mCtx = SSL_CTX_new(method); if(mCtx == NULL) { throw net::ssl::SSLException(Ctxt(FmtX("SSL_CTX_new failed"))); } if(mClientAuthentication) { // Load our keys and certificates if(!(SSL_CTX_use_certificate_file(mCtx, mKeyfile.c_str(), SSL_FILETYPE_PEM))) throw net::ssl::SSLException(Ctxt("Can't read certificate file")); //SSL_CTX_set_default_passwd_cb(mCtx, password_cb); if(!(SSL_CTX_use_PrivateKey_file(mCtx, mKeyfile.c_str(), SSL_FILETYPE_PEM))) throw net::ssl::SSLException(Ctxt("Can't read key file")); // Load the CAs we trust if(!(SSL_CTX_load_verify_locations(mCtx, mCAList.c_str(), 0))) throw net::ssl::SSLException(Ctxt("Can't read CA list")); // Set our cipher list if(mCiphers) { SSL_CTX_set_cipher_list(mCtx, mCiphers); } } // Load randomness /* if(!RAND_load_file("random.pem", 1024*1024)) throw net::ssl::SSLException(Ctxt("Couldn't load randomness")); */ #if (OPENSSL_VERSION_NUMBER < 0x00905100L) SSL_CTX_set_verify_depth(mCtx, 1);#endif#endif}
开发者ID:mdaus,项目名称:nitro,代码行数:55,
示例8: bufvoid FileHeader::blockReadHeader(io::SeekableInputStream& inStream, size_t blockSize, std::string& headerBlock){ static const char ERROR_MSG[] = "CPHD file malformed: Header must terminate with '//f//n'"; mem::ScopedArray<sys::byte> buf(new sys::byte[blockSize + 1]); std::fill_n(buf.get(), blockSize + 1, 0); headerBlock.clear(); // read each block in succession size_t terminatorLoc = std::string::npos; size_t totalBytesRead = 0; while (inStream.read(buf.get(), blockSize) != io::InputStream::IS_EOF && terminatorLoc == std::string::npos) { std::string thisBlock = buf.get(); // find the terminator in the block terminatorLoc = thisBlock.find('/f'); if (terminatorLoc != std::string::npos) { // read one more byte if our block missed the trailing '/n' if (terminatorLoc == thisBlock.length() - 1) { sys::byte c(0); inStream.read(&c, 1); thisBlock.insert(thisBlock.length(), &c, 1); } // verify proper formatting if (thisBlock[terminatorLoc + 1] != '/n') { throw except::Exception(Ctxt(ERROR_MSG)); } // trim off anything after the terminator thisBlock = thisBlock.substr(0, terminatorLoc); } // build the header headerBlock += thisBlock; // verify we aren't past 10MB in the header -- // this stops processing before we start reading into the // image data and potentially run out of memory totalBytesRead += thisBlock.length(); if (totalBytesRead > MAX_HEADER_SIZE) { throw except::Exception(Ctxt(ERROR_MSG)); } }}
开发者ID:BSteine,项目名称:six-library,代码行数:53,
示例9: findSegmentvoid ImageBlocker::findSegmentRange(size_t startRow, size_t numRows, size_t& firstSegIdx, size_t& startBlockWithinFirstSeg, size_t& lastSegIdx, size_t& lastBlockWithinLastSeg) const{ if (numRows == 0) { firstSegIdx = startBlockWithinFirstSeg = lastSegIdx = lastBlockWithinLastSeg = std::numeric_limits<size_t>::max(); } else { // Figure out which segment we're starting in size_t startRowWithinFirstSeg; findSegment(startRow, firstSegIdx, startRowWithinFirstSeg, startBlockWithinFirstSeg); if (!isFirstRowInBlock(startRowWithinFirstSeg)) { std::ostringstream ostr; ostr << "Start row " << startRow << " is local row " << startRowWithinFirstSeg << " within segment " << firstSegIdx << ". The local row must be a multiple of " << mNumRowsPerBlock << "."; throw except::Exception(Ctxt(ostr.str())); } // Figure out which segment we're ending in const size_t lastRow = startRow + numRows - 1; size_t lastRowWithinLastSeg; findSegment(lastRow, lastSegIdx, lastRowWithinLastSeg, lastBlockWithinLastSeg); const size_t endRowWithinLastSeg = lastRowWithinLastSeg + 1; // Make sure we're ending on a full block if (!(endRowWithinLastSeg == mNumRows[lastSegIdx] || isFirstRowInBlock(endRowWithinLastSeg))) { std::ostringstream ostr; ostr << "Last row " << lastRow << " is local row " << lastRowWithinLastSeg << " within segment " << lastSegIdx << ". This must land on a full block."; throw except::Exception(Ctxt(ostr.str())); } }}
开发者ID:tclarke,项目名称:nitro,代码行数:50,
示例10: Ctxtint sys::ExecPipe::closePipe(){ if (!mOutStream) { throw except::IOException( Ctxt("The stream is already closed")); } // in case it fails FILE* tmp = mOutStream; mOutStream = NULL; int exitStatus = 0; const int encodedStatus = pclose(tmp); if (WIFEXITED(encodedStatus)) { // get exit code from child process exitStatus = WEXITSTATUS(encodedStatus); } else { //! unix gives a little better granularity on errors // due to uncaught signal (ex. segFault) if (WIFSIGNALED(encodedStatus)) { throw except::IOException( Ctxt("The child process was terminated by " / "an uncaught signal: " + str::toString<int>(WTERMSIG(encodedStatus)))); } // due to unplanned stoppage if (WIFSTOPPED(encodedStatus)) { throw except::IOException( Ctxt("The child process was unexpectedly stopped: " + str::toString<int>(WSTOPSIG(encodedStatus)))); } // all other errors sys::SocketErr err; throw except::IOException( Ctxt("Failure while closing stream to child process: " + err.toString())); } return exitStatus;}
开发者ID:aivaras16,项目名称:nitro,代码行数:50,
示例11: definedstd::string sys::OSUnix::getTempName(const std::string& path, const std::string& prefix) const{ std::string name;#if defined(_USE_MKSTEMP) || defined(__linux__) || defined(__linux) || defined(linux__) std::string pathname(path); pathname += "/" + prefix + "XXXXXX"; std::vector<char> fullPath(pathname.size() + 1); strcpy(&fullPath[0], pathname.c_str()); int ret = mkstemp(&fullPath[0]); if (ret == -1) name = ""; else { name = &fullPath[0]; }#else CharWrapper tempname = tempnam(path.c_str(), prefix.c_str()); if (tempname.get() == NULL) name = ""; else { name = tempname.get(); sys::File (name, sys::File::WRITE_ONLY, sys::File::CREATE); }#endif if (name.empty()) { throw except::Exception(Ctxt("Unable to create a temporary file")); } return name;}
开发者ID:mdaus,项目名称:nitro,代码行数:31,
示例12: packedRecrypt// Use packed bootstrapping, so we can bootstrap all in just one go.void packedRecrypt(const CtPtrs& cPtrs, const std::vector<zzX>& unpackConsts, const EncryptedArray& ea){ FHEPubKey& pKey = (FHEPubKey&)cPtrs[0]->getPubKey(); // Allocate temporary ciphertexts for the recryption int nPacked = divc(cPtrs.size(), ea.getDegree()); // ceil(totoalNum/d) std::vector<Ctxt> cts(nPacked, Ctxt(pKey)); repack(CtPtrs_vectorCt(cts), cPtrs, ea); // pack ciphertexts // cout << "@"<< lsize(cts)<<std::flush; for (Ctxt& c: cts) { // then recrypt them c.reducePtxtSpace(2); // we only have recryption data for binary ctxt#ifdef DEBUG_PRINTOUT ZZX ptxt; decryptAndPrint((cout<<" before recryption "), c, *dbgKey, *dbgEa); dbgKey->Decrypt(ptxt, c); c.DummyEncrypt(ptxt); decryptAndPrint((cout<<" after recryption "), c, *dbgKey, *dbgEa);#else pKey.reCrypt(c);#endif } unpack(cPtrs, CtPtrs_vectorCt(cts), ea, unpackConsts);}
开发者ID:fionser,项目名称:HElib,代码行数:27,
示例13: destroyRegex& Regex::compile(const std::string& pattern){ mPattern = pattern; destroy(); // TODO: So, I would like an RAII object for this. But, this object would // need to call pcre2_compile() in its constructor rather than take // ownership of a pointer (so that it has access to the error code // information on failure) and its copy constructor / assignment // operator would need to hold onto mPattern. At that point the // class is close to being this Regex class itself. static const int FLAGS = PCRE2_DOTALL; int errorCode; PCRE2_SIZE errorOffset; mPCRE = pcre2_compile(reinterpret_cast<PCRE2_SPTR>(mPattern.c_str()), mPattern.length(), FLAGS, &errorCode, &errorOffset, NULL); // Use default compile context if (mPCRE == NULL) { std::ostringstream ostr; ostr << "PCRE compilation failed at offset " << errorOffset << ": " << getErrorMessage(errorCode); throw RegexException(Ctxt(ostr.str())); } return *this;}
开发者ID:mdaus,项目名称:nitro,代码行数:32,
示例14: addImagevoid CPHDWriter::addImage(const T* image, const types::RowCol<size_t>& dims, const sys::ubyte* vbmData){ if (mElementSize != sizeof(T)) { throw except::Exception(Ctxt( "Incorrect buffer data type used for metadata!")); } //! If this is the first time you called addImage. We will clear // out the metadata image here and start adding it manually. if (mCPHDData.empty()) { mMetadata.data.arraySize.clear(); mMetadata.data.numCPHDChannels = 0; } mVBMData.push_back(vbmData); mCPHDData.push_back(reinterpret_cast<const sys::ubyte*>(image)); mCPHDSize += dims.normL1() * mElementSize; mVBMSize += dims.row * mMetadata.data.getNumBytesVBP(); mMetadata.data.numCPHDChannels += 1; mMetadata.data.arraySize.push_back(ArraySize(dims.row, dims.col));}
开发者ID:BSteine,项目名称:six-library,代码行数:27,
示例15: throwvoid ImageSubheader::setPixelInformation(std::string pvtype, nitf::Uint32 nbpp, nitf::Uint32 abpp, std::string justification, std::string irep, std::string icat, std::vector<nitf::BandInfo>& bands) throw(nitf::NITFException){ const size_t bandCount = bands.size(); nitf_BandInfo ** bandInfo = (nitf_BandInfo **)NITF_MALLOC( sizeof(nitf_BandInfo*) * bandCount); if (!bandInfo) { throw nitf::NITFException(Ctxt(FmtX("Out of Memory"))); } for (size_t i = 0; i < bandCount; i++) { bandInfo[i] = nitf_BandInfo_clone(bands[i].getNative(), &error); if (!bandInfo[i]) throw nitf::NITFException(&error); } NITF_BOOL x = nitf_ImageSubheader_setPixelInformation(getNativeOrThrow(), pvtype.c_str(), nbpp, abpp, justification.c_str(), irep.c_str(), icat.c_str(), static_cast<nitf::Uint32>(bandCount), bandInfo, &error); if (!x) throw nitf::NITFException(&error);}
开发者ID:mdaus,项目名称:nitro,代码行数:28,
示例16: CreateFilevoid sys::File::create(const std::string& str, int accessFlags, int creationFlags){ // If the truncate bit is on AND the file does exist, // we need to set the mode to TRUNCATE_EXISTING if ((creationFlags & sys::File::TRUNCATE) && sys::OS().exists(str) ) { creationFlags = TRUNCATE_EXISTING; } else { creationFlags = ~sys::File::TRUNCATE & creationFlags; } mHandle = CreateFile(str.c_str(), accessFlags, FILE_SHARE_READ, NULL, creationFlags, FILE_ATTRIBUTE_NORMAL, NULL); if (mHandle == SYS_INVALID_HANDLE) { throw sys::SystemException(Ctxt(FmtX("Error opening file: [%s]", str.c_str()))); } mPath = str;}
开发者ID:ngageoint,项目名称:six-library,代码行数:27,
示例17: SystemExceptionvoid sys::File::flush(){ if (!FlushFileBuffers(mHandle)) { throw sys::SystemException(Ctxt("Error flushing file " + mPath)); }}
开发者ID:ngageoint,项目名称:six-library,代码行数:7,
示例18: mMaxBufferSizeBufferedReader::BufferedReader(const std::string& file, void* buffer, size_t size, bool adopt) : mMaxBufferSize(size), mScopedBuffer(adopt ? static_cast<char*>(buffer) : NULL), mBuffer(static_cast<char*>(buffer)), mPosition(0), mBufferSize(0), mTotalRead(0), mBlocksRead(0), mPartialBlocks(0), mElapsedTime(0), mFile(file, sys::File::READ_ONLY, sys::File::EXISTING), mFileLen(mFile.length()){ if (mMaxBufferSize == 0) { throw except::Exception(Ctxt( "BufferedReaders must have a buffer size greater than zero")); } //! Start off by reading a block readNextBuffer();}
开发者ID:mdaus,项目名称:nitro,代码行数:25,
示例19: readImplvoid BufferedReader::readImpl(void* buf, size_t size){ //! Ensure there is enough data to read if (tell() + static_cast<nitf::Off>(size) > getSize()) { throw except::Exception(Ctxt( "Attempting to read past the end of a buffered reader.")); } char* bufPtr = static_cast<char*>(buf); size_t amountLeftToRead = size; size_t offset = 0; while (amountLeftToRead) { const size_t readSize = std::min(amountLeftToRead, mBufferSize - mPosition); memcpy(bufPtr + offset, mBuffer + mPosition, readSize); mPosition += readSize; offset += readSize; amountLeftToRead -= readSize; if (mPosition >= mBufferSize) { readNextBuffer(); } }}
开发者ID:mdaus,项目名称:nitro,代码行数:29,
示例20: setenvvoid sys::OSUnix::setEnv(const std::string& var, const std::string& val, bool overwrite){ int ret;#ifdef HAVE_SETENV ret = setenv(var.c_str(), val.c_str(), overwrite);#else // putenv() will overwrite the value if it already exists, so if we don't // want to overwrite, we do nothing when getenv() indicates the variable's // already set if (overwrite || getenv(var.c_str()) == NULL) { // putenv() isn't guaranteed to make a copy of the string, so we need // to allocate it and let it leak. Ugh. char* const strBuffer = new char[var.length() + 1 + val.length() + 1]; ::sprintf(strBuffer, "%s=%s", var.c_str(), val.c_str()); ret = putenv(strBuffer); } else { ret = 0; }#endif if(ret != 0) { throw sys::SystemException(Ctxt( "Unable to set unix environment variable " + var)); }}
开发者ID:mdaus,项目名称:nitro,代码行数:31,
示例21: throwvoid io::FileUtils::forceMkdir(std::string dirname) throw (except::IOException){ sys::OS os; if (os.exists(dirname)) { if (!os.isDirectory(dirname)) throw except::IOException( Ctxt( "Cannot create directory - file already exists")); } else { if (!os.makeDirectory(dirname)) throw except::IOException(Ctxt("Cannot create directory")); }}
开发者ID:abellgithub,项目名称:nitro,代码行数:16,
示例22: getNativeOrThrow //! Get native object virtual T * getNativeOrThrow() const throw(nitf::NITFException) { T* val = getNative(); if (val) return val; throw nitf::NITFException(Ctxt("Invalid handle")); }
开发者ID:amandamt1224,项目名称:Neko,代码行数:8,
示例23: newElementXMLElem ComplexXMLParser10x::convertRMAToXML( const RMA* rma, XMLElem parent) const{ XMLElem rmaXML = newElement("RMA", parent); createString("RMAlgoType", six::toString<six::RMAlgoType>(rma->algoType), rmaXML); if (rma->rmat.get() && !rma->rmcr.get() && !rma->inca.get()) { convertRMATToXML(rma->rmat.get(), rmaXML); } else if (!rma->rmat.get() && rma->rmcr.get() && !rma->inca.get()) { convertRMCRToXML(rma->rmcr.get(), rmaXML); } else if (!rma->rmat.get() && !rma->rmcr.get() && rma->inca.get()) { convertINCAToXML(rma->inca.get(), rmaXML); } else { throw except::Exception(Ctxt( "One of RMAT, RMCR or INCA must be defined in SICD 1.0.")); } return rmaXML;}
开发者ID:BSteine,项目名称:six-library,代码行数:29,
示例24: convertPFAToXMLXMLElem ComplexXMLParser10x::convertImageFormationAlgoToXML( const PFA* pfa, const RMA* rma, const RgAzComp* rgAzComp, XMLElem parent) const{ if (pfa && !rma && !rgAzComp) { return convertPFAToXML(pfa, parent); } else if (!pfa && rma && !rgAzComp) { return convertRMAToXML(rma, parent); } else if (!pfa && !rma && rgAzComp) { return convertRgAzCompToXML(rgAzComp, parent); } else if (!pfa && !rma && !rgAzComp) { //! This will occur when set to OTHER. We do not want to include // a specialized image formation algorithm so we return NULL. return NULL; } else { throw except::Exception(Ctxt( "Only one PFA, RMA, or RgAzComp can be defined in SICD 1.0")); }}
开发者ID:BSteine,项目名称:six-library,代码行数:28,
示例25: byteSwapAndScalevoid byteSwapAndScale(const void* input, size_t elementSize, const types::RowCol<size_t>& dims, const double* scaleFactors, size_t numThreads, std::complex<float>* output){ switch (elementSize) { case 2: ::byteSwapAndScale<sys::Int8_T>(input, dims, scaleFactors, numThreads, output); break; case 4: ::byteSwapAndScale<sys::Int16_T>(input, dims, scaleFactors, numThreads, output); break; case 8: ::byteSwapAndScale<float>(input, dims, scaleFactors, numThreads, output); break; default: throw except::Exception(Ctxt( "Unexpected element size " + str::toString(elementSize))); }}
开发者ID:ngageoint,项目名称:six-library,代码行数:26,
示例26: SetEnvironmentVariablevoid sys::OSWin32::setEnv(const std::string& var, const std::string& val, bool overwrite){ BOOL ret = SetEnvironmentVariable(var.c_str(), val.c_str()); if(!ret) throw sys::SystemException(Ctxt(FmtX("Unable to set windows environment variable %s", var.c_str())));}
开发者ID:amandamt1224,项目名称:Neko,代码行数:8,
示例27: throwstd::string net::URLParams::getFirst(std::string key) const throw (except::NoSuchKeyException){ net::URLParams::Params::const_iterator it = mParams.find(key); if (it == mParams.end() || it->second.size() == 0) throw except::NoSuchKeyException(Ctxt(key)); return it->second.front();}
开发者ID:adam-beauchamp,项目名称:coda-oss,代码行数:8,
示例28: getenvstd::string sys::OSUnix::getEnv(const std::string& s) const{ const char* envVal = getenv(s.c_str()); if (envVal == NULL) throw sys::SystemException( Ctxt("Unable to get unix environment variable " + s)); return std::string(envVal);}
开发者ID:mdaus,项目名称:nitro,代码行数:8,
示例29: sysconfsize_t sys::OSUnix::getNumCPUs() const{#ifdef _SC_NPROCESSORS_ONLN return sysconf(_SC_NPROCESSORS_ONLN);#else throw except::NotImplementedException(Ctxt("Unable to get the number of CPUs"));#endif}
开发者ID:mdaus,项目名称:nitro,代码行数:8,
注:本文中的Ctxt函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CuAssert函数代码示例 C++ Ctrl_access_unlock函数代码示例 |