本文整理汇总了C++中pathName函数的典型用法代码示例。如果您正苦于以下问题:C++ pathName函数的具体用法?C++ pathName怎么用?C++ pathName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pathName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: path
std::string JSCEnum::enumName() const {
std::string result;
const auto lPath = path();
if (lPath.size() > 2) {
return lPath[1] + "_" + pathName();
}
return pathName();
}
示例2: SkFontStyleSet_Android
explicit SkFontStyleSet_Android(const FontFamily& family,
const SkTypeface_FreeType::Scanner& scanner)
{
const SkString* cannonicalFamilyName = NULL;
if (family.fNames.count() > 0) {
cannonicalFamilyName = &family.fNames[0];
}
// TODO? make this lazy
for (int i = 0; i < family.fFonts.count(); ++i) {
const FontFileInfo& fontFile = family.fFonts[i];
SkString pathName(family.fBasePath);
pathName.append(fontFile.fFileName);
SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(pathName.c_str()));
if (!stream.get()) {
SkDEBUGF(("Requested font file %s does not exist or cannot be opened.\n",
pathName.c_str()));
continue;
}
const int ttcIndex = fontFile.fIndex;
SkString familyName;
SkFontStyle style;
bool isFixedWidth;
if (!scanner.scanFont(stream.get(), ttcIndex, &familyName, &style, &isFixedWidth)) {
SkDEBUGF(("Requested font file %s exists, but is not a valid font.\n",
pathName.c_str()));
continue;
}
int weight = fontFile.fWeight != 0 ? fontFile.fWeight : style.weight();
SkFontStyle::Slant slant = style.slant();
switch (fontFile.fStyle) {
case FontFileInfo::Style::kAuto: slant = style.slant(); break;
case FontFileInfo::Style::kNormal: slant = SkFontStyle::kUpright_Slant; break;
case FontFileInfo::Style::kItalic: slant = SkFontStyle::kItalic_Slant; break;
default: SkASSERT(false); break;
}
style = SkFontStyle(weight, style.width(), slant);
const SkLanguage& lang = family.fLanguage;
uint32_t variant = family.fVariant;
if (kDefault_FontVariant == variant) {
variant = kCompact_FontVariant | kElegant_FontVariant;
}
// The first specified family name overrides the family name found in the font.
// TODO: SkTypeface_AndroidSystem::onCreateFamilyNameIterator should return
// all of the specified family names in addition to the names found in the font.
if (cannonicalFamilyName != NULL) {
familyName = *cannonicalFamilyName;
}
fStyles.push_back().reset(SkNEW_ARGS(SkTypeface_AndroidSystem,
(pathName, ttcIndex,
style, isFixedWidth, familyName,
lang, variant)));
}
}
示例3: curl_escape
void LLWLParamManager::savePreset(const std::string & name)
{
// bugfix for SL-46920: preventing filenames that break stuff.
char * curl_str = curl_escape(name.c_str(), name.size());
std::string escaped_filename(curl_str);
curl_free(curl_str);
curl_str = NULL;
escaped_filename += ".xml";
// make an empty llsd
LLSD paramsData(LLSD::emptyMap());
std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename));
// fill it with LLSD windlight params
paramsData = mParamList[name].getAll();
// write to file
llofstream presetsXML(pathName);
LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);
presetsXML.close();
propagateParameters();
notifyObservers();
}
示例4: pathName
String Directory::MakePathName(bool addSepFlag, const char *pathNameTrail) const
{
String pathName(_name);
for (Directory *pDirectory = GetParent(); pDirectory != nullptr;
pDirectory = pDirectory->GetParent()) {
// a "boundary container" directory may have an empty name
if (*pDirectory->GetName() != '\0' || pDirectory->IsRootContainer()) {
String str(pDirectory->GetName());
size_t len = str.size();
if (len == 0 || !IsFileSeparator(str[len - 1])) {
str += pDirectory->GetSeparator();
}
str += pathName;
pathName = str;
}
}
if (pathNameTrail != nullptr) {
size_t len = pathName.size();
if (len == 0 || !IsFileSeparator(pathName[len - 1])) {
pathName += GetSeparator();
}
for (const char *p = pathNameTrail; *p != '\0'; p++) {
char ch = IsFileSeparator(*p)? GetSeparator() : *p;
pathName += ch;
}
} else if (addSepFlag && IsContainer() && !_name.empty()) {
size_t len = pathName.size();
if (len > 0 && !IsFileSeparator(pathName[len - 1])) {
pathName += GetSeparator();
}
}
return pathName;
}
示例5: pathName
Directory *Directory_FileSys::DoNext(Environment &env)
{
WIN32_FIND_DATA findData;
if (_hFind == INVALID_HANDLE_VALUE) {
String pathName(MakePathName(false));
if (!pathName.empty()) pathName += GetSeparator();
pathName += "*.*";
_hFind = ::FindFirstFile(OAL::ToNativeString(pathName.c_str()).c_str(), &findData);
if (_hFind == INVALID_HANDLE_VALUE) return nullptr;
} else if (!::FindNextFile(_hFind, &findData)) {
::FindClose(_hFind);
_hFind = INVALID_HANDLE_VALUE;
return nullptr;
}
while (::strcmp(findData.cFileName, ".") == 0 ||
::strcmp(findData.cFileName, "..") == 0) {
if (!::FindNextFile(_hFind, &findData)) {
::FindClose(_hFind);
_hFind = INVALID_HANDLE_VALUE;
return nullptr;
}
}
Type type = (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)?
TYPE_Container : TYPE_Item;
String fileName = OAL::FromNativeString(findData.cFileName);
return new Directory_FileSys(Directory::Reference(this), fileName.c_str(),
type, new OAL::FileStat(fileName.c_str(), findData));
}
示例6: delItems
void Mailbox::readSettings(QSettings *config)
{
_name = config->value("name").toString();
oldName = config->value("oldname").toString();
delimiter = config->value("delimiter").toString();
uid = config->value("uid").toString();
exists = config->value("exists", 0).toInt();
byUser = config->value("byuser").toBool();
deleted = config->value("deleted").toBool();
QString delItems(config->value("queuedelete").toString().trimmed());
if (!delItems.isEmpty())
delList = delItems.split( "," );
_localCopy = config->value("localcopy", false ).toBool();
_syncSetting = config->value("syncsettings", Sync_AllMessages).toInt();
serverUidList.clear();
QString str;
for (int x = 1; x < (exists + 1); x++) {
int theUid = config->value( QString::number(x) ).toInt();
str = QString::number(theUid);
if ( !str.isEmpty() )
serverUidList.append( str );
}
search->setFromFolder( pathName() );
if(_account && _account->accountType() == QMailAccount::IMAP)
_displayName = decodeModUTF7(baseName());
else
_displayName = _name;
}
示例7: _LIT
TInt CTestUtils::OpenMainLogL()
{
_LIT(KDisplayLogFile,"Log File %S\n");
TParse loglocation;
TFileName logfile;
TInt err=ResolveLogFile(KNullDesC, loglocation);
if(err!=KErrNone)
{
TChar driveChar=RFs::GetSystemDriveChar();
TBuf<2> systemDrive;
systemDrive.Append(driveChar);
systemDrive.Append(KDriveDelimiter);
TPath pathName(systemDrive) ;
pathName.Append(KMsvTestFileDefaultOutputBase);
iFs.MkDirAll(pathName);
err=ResolveLogFile(KNullDesC, loglocation);
}
User::LeaveIfError(err);
logfile.Copy(loglocation.FullName());
logfile.Delete(logfile.Length()-1,1);
AppendVariantName(logfile);
iRTest.Printf(KDisplayLogFile, &logfile);
iFs.MkDirAll(logfile);
iLogBuf=HBufC::NewL(KMaxLogLineLength);
iLogBuf8=HBufC8::NewL(KMaxLogLineLength);
return(iFile.Replace(iFs,logfile,EFileWrite|EFileShareAny));
}
示例8: paramsData
void LLWLParamManager::savePresets(const std::string & fileName)
{
//Nobody currently calls me, but if they did, then its reasonable to write the data out to the user's folder
//and not over the RO system wide version.
LLSD paramsData(LLSD::emptyMap());
std::string pathName(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", fileName));
for(std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.begin();
mIt != mParamList.end();
++mIt)
{
paramsData[mIt->first] = mIt->second.getAll();
}
llofstream presetsXML(pathName);
LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);
presetsXML.close();
propagateParameters();
}
示例9: pathName
void CMsvIndexContext::DoStoreConfigL()
{
// we only want to store the config file if it has changed,
// we also don't care about UniqueIDs for the internal drive
if(iConfig.iDebug!=iConfig.iDebugAsLoaded ||
iConfig.iDrive!=iConfig.iDriveAsLoaded ||
(iConfig.iDrive!=iServer.FileSession().GetSystemDrive() && iConfig.iUniqueID!=iConfig.iUniqueIDAsLoaded))
{
TChar driveChar= iServer.FileSession().GetSystemDriveChar();
TBuf<2> systemDrive;
systemDrive.Append(driveChar);
systemDrive.Append(KDriveDelimiter);
TPath pathName(systemDrive);
pathName.Append(KServerINIFile);
CDictionaryFileStore *store=CDictionaryFileStore::OpenLC(iServer.FileSession(),pathName,KNullUid);
RDictionaryWriteStream stream;
stream.AssignLC(*store, KUidMsvMessageDriveStream);
stream.WriteUint8L(KMsvMessageDriveStreamVersionNumber); // version number
stream << iConfig.iDrive.Name();
stream.WriteUint32L(iConfig.iUniqueID);
stream.WriteInt8L(iConfig.iDebug);
stream.CommitL();
store->CommitL();
CleanupStack::PopAndDestroy(2,store); // stream, store
}
}
示例10: curl_escape
void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
{
// bugfix for SL-46920: preventing filenames that break stuff.
char * curl_str = curl_escape(name.c_str(), name.size());
std::string escaped_filename(curl_str);
curl_free(curl_str);
curl_str = NULL;
escaped_filename += ".xml";
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", escaped_filename));
LL_DEBUGS2("AppInit", "Shaders") << "Loading WindLight sky setting from " << pathName << LL_ENDL;
llifstream presetsXML;
presetsXML.open(pathName.c_str());
// That failed, try loading from the users area instead.
if(!presetsXML)
{
pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename);
LL_DEBUGS2("AppInit", "Shaders")<< "Loading User WindLight sky setting from " << LL_ENDL;
presetsXML.open(pathName.c_str());
}
if (presetsXML)
{
LLSD paramsData(LLSD::emptyMap());
LLPointer<LLSDParser> parser = new LLSDXMLParser();
parser->parse(presetsXML, paramsData, LLSDSerialize::SIZE_UNLIMITED);
std::map<std::string, LLWLParamSet>::iterator mIt = mParamList.find(name);
if(mIt == mParamList.end())
{
addParamSet(name, paramsData);
}
else
{
setParamSet(name, paramsData);
}
presetsXML.close();
}
else
{
llwarns << "Can't find " << name << llendl;
return;
}
if(propagate)
{
getParamSet(name, mCurParams);
propagateParameters();
}
notifyObservers();
}
示例11: getParamSet
void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
{
// Check if we already have the preset before we try loading it again.
if(mParamList.find(name) != mParamList.end())
{
if(propagate)
{
getParamSet(name, mCurParams);
propagateParameters();
}
return;
}
// bugfix for SL-46920: preventing filenames that break stuff.
char * curl_str = curl_escape(name.c_str(), name.size());
std::string escaped_filename(curl_str);
curl_free(curl_str);
curl_str = NULL;
escaped_filename += ".xml";
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/skies", escaped_filename));
LL_DEBUGS2("AppInit", "Shaders") << "Loading WindLight sky setting from " << pathName << LL_ENDL;
llifstream presetsXML;
presetsXML.open(pathName.c_str());
// That failed, try loading from the users area instead.
if(!presetsXML)
{
pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", escaped_filename);
LL_DEBUGS2("AppInit", "Shaders")<< "Loading User WindLight sky setting from " << LL_ENDL;
presetsXML.open(pathName.c_str());
}
if (presetsXML)
{
loadPresetXML(name, presetsXML);
presetsXML.close();
}
else
{
llwarns << "Can't find " << name << llendl;
return;
}
if(propagate)
{
getParamSet(name, mCurParams);
propagateParameters();
}
notifyObservers();
}
示例12: mVBO
LLPostProcess::LLPostProcess(void) :
mVBO(NULL),
mAllEffects(LLSD::emptyMap()),
mScreenWidth(1), mScreenHeight(1)
{
mSceneRenderTexture = NULL ;
mNoiseTexture = NULL ;
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.*/
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
LL_DEBUGS2("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL;
llifstream effectsXML(pathName);
if (effectsXML)
{
LLPointer<LLSDParser> parser = new LLSDXMLParser();
parser->parse(effectsXML, mAllEffects, LLSDSerialize::SIZE_UNLIMITED);
}
if (!mAllEffects.has("default"))
{
LLSD & defaultEffect = (mAllEffects["default"] = LLSD::emptyMap());
/*defaultEffect["enable_night_vision"] = LLSD::Boolean(false);
defaultEffect["enable_color_filter"] = LLSD::Boolean(false);*/
/// NVG Defaults
defaultEffect["brightness_multiplier"] = 3.0;
defaultEffect["noise_size"] = 25.0;
defaultEffect["noise_strength"] = 0.4;
// TODO BTest potentially add this to tweaks?
mNoiseTextureScale = 1.0f;
/// Color Filter Defaults
defaultEffect["gamma"] = 1.0;
defaultEffect["brightness"] = 1.0;
defaultEffect["contrast"] = 1.0;
defaultEffect["saturation"] = 1.0;
LLSD& contrastBase = (defaultEffect["contrast_base"] = LLSD::emptyArray());
contrastBase.append(1.0);
contrastBase.append(1.0);
contrastBase.append(1.0);
contrastBase.append(0.5);
defaultEffect["gauss_blur_passes"] = 2;
}
setSelectedEffect("default");
//*/
}
示例13: if
/**
* Removes model from project and deletes its file.
*/
bool BaseModel::remove(){
bool succ = QFile::remove(pathName());
if(succ){
prj->removeModel(this);
return true;
}
else if(!QFile::exists(pathName())){
prj->removeModel(this);
return true;
}
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Delete"));
msgBox.setText(tr("File can't be deleted."));
msgBox.setInformativeText(pathName());
msgBox.setIcon(QMessageBox::Critical);
msgBox.exec();
return false;
}
示例14: path
/**
* Sets new model name, renames model file end emits rename signal.
*/
void BaseModel::rename(QString name){
bool succ = QFile::rename(pathName(), path() + "/" + name + ".xml");
if(succ){
QString oldName = mdlName;
mdlName = name;
save();
prj->save();
prj->emitModelRenamed(mdlName, oldName, mdlType);
emit changed(ModelRenamed);
return;
}
QMessageBox msgBox;
msgBox.setWindowTitle(tr("Rename"));
msgBox.setText(tr("File can't be renamed."));
msgBox.setInformativeText(pathName() + " -> " + path() + "/" + name + ".xml");
msgBox.setIcon(QMessageBox::Critical);
msgBox.exec();
}
示例15: pathName
void LLWaterParamManager::loadPreset(const std::string & name,bool propagate)
{
// bugfix for SL-46920: preventing filenames that break stuff.
std::string escaped_filename = LLWeb::curlEscape(name);
escaped_filename += ".xml";
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", escaped_filename));
llinfos << "Loading water settings from " << pathName << llendl;
std::ifstream presetsXML;
presetsXML.open(pathName.c_str());
// That failed, try loading from the users area instead.
if(!presetsXML)
{
pathName=gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", escaped_filename);
llinfos << "Loading User water setting from " << pathName << llendl;
presetsXML.open(pathName.c_str());
}
if (presetsXML)
{
LLSD paramsData(LLSD::emptyMap());
LLPointer<LLSDParser> parser = new LLSDXMLParser();
parser->parse(presetsXML, paramsData, LLSDSerialize::SIZE_UNLIMITED);
std::map<std::string, LLWaterParamSet>::iterator mIt = mParamList.find(name);
if(mIt == mParamList.end())
{
addParamSet(name, paramsData);
}
else
{
setParamSet(name, paramsData);
}
presetsXML.close();
}
else
{
llwarns << "Can't find " << name << llendl;
return;
}
if(propagate)
{
getParamSet(name, mCurParams);
propagateParameters();
}
}