本文整理汇总了C++中FilePath::path方法的典型用法代码示例。如果您正苦于以下问题:C++ FilePath::path方法的具体用法?C++ FilePath::path怎么用?C++ FilePath::path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePath
的用法示例。
在下文中一共展示了FilePath::path方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testConversion
void FilePathTest::testConversion( void )
{
String s( "foo/bar/baaz" );
FilePath p;
CPPUNIT_ASSERT( s.to<>( p ) );
CPPUNIT_ASSERT_EQUAL( s, p.path() );
CPPUNIT_ASSERT_EQUAL( s, s.as<FilePath>().path() );
}
示例2: BadKeyFileEx
Context::Context( FilePath const &keyFile )
: _ctx( *SSL_CTX_new( SSLv23_method() ) )
{
// load the certs (probably not used, but if left out it causes problems)
if ( SSL_CTX_use_certificate_chain_file( &_ctx, keyFile.path() ) != 1 )
throw BadKeyFileEx( keyFile );
// load the keys
if ( SSL_CTX_use_PrivateKey_file( &_ctx, keyFile, SSL_FILETYPE_PEM ) != 1 )
throw BadKeyFileEx( keyFile );
}
示例3: LogChannel
//=============================================================================
FileLogChannel::FileLogChannel(const std::string& name,
const FilePath& path,
bool fallback)
: LogChannel(name),
m_fallback(fallback)
{
if (Ok != m_file.open(path, File::Write | File::Append | File::Create,
0640)) {
if (m_fallback) {
std::cerr << "Unable to open log file '"
<< path.path() << "' - will log to stdout\n";
}
} else {
m_file.write("\n----------\n\n");
}
}
示例4: find
bool find(const std::string& name, FilePath& result, bool recursive=true) {
bool found = false;
if (dir && APR_SUCCESS == check_apr(apr_dir_open(&dir, dirname.c_str(), mPool))) {
// iterate over directory:
while ((!found) && APR_SUCCESS == (apr_dir_read(&dirent, APR_FINFO_TYPE|APR_FINFO_NAME, dir))) {
//printf("test %s %s\n", dirname.c_str(), dirent.name);
if (dirent.filetype == APR_REG && dirent.name && std::string(dirent.name) == name) {
result.file(dirent.name);
result.path(dirname);
found = true;
break;
} else if (recursive && dirent.filetype == APR_DIR && dirent.name && dirent.name[0] != '.') {
Path path(dirname + dirent.name + AL_FILE_DELIMITER);
found = path.find(name, result, true);
}
}
} else {
printf("couldn't open directory %s\n", dirname.c_str());
}
return found;
}
示例5: glob
int glob(const std::string& regex, FileList& result, bool recursive=true) {
std::regex e(regex);
if (dir && APR_SUCCESS == check_apr(apr_dir_open(&dir, dirname.c_str(), mPool))) {
// iterate over directory:
while (APR_SUCCESS == (apr_dir_read(&dirent, APR_FINFO_TYPE|APR_FINFO_NAME, dir))) {
//printf("test %s %s\n", dirname.c_str(), dirent.name);
if (dirent.filetype == APR_REG && dirent.name && std::regex_match(dirname+dirent.name,e) ) {
FilePath res;
res.file(dirent.name);
res.path(dirname);
result.add(res);
} else if (recursive && dirent.filetype == APR_DIR && dirent.name && dirent.name[0] != '.') {
Path path(dirname + dirent.name + AL_FILE_DELIMITER);
path.glob(regex, result, true);
}
}
} else {
AL_WARN("couldn't open directory %s", dirname.c_str());
}
return result.count();
}
示例6: readXml
void ConfigManager::readXml(const icl_core::String& prefix, TiXmlNode *node, FilePath fp, bool extend_prefix)
{
icl_core::String node_name(node->Value());
icl_core::String fq_node_name = prefix;
if (extend_prefix)
{
fq_node_name = prefix + "/" + node_name;
}
TiXmlNode *child = node->IterateChildren(NULL);
while (child != 0)
{
if (child->Type() == TiXmlNode::TINYXML_ELEMENT)
{
if (strcmp(child->Value(), "INCLUDE") == 0)
{
TiXmlElement *child_element = dynamic_cast<TiXmlElement*>(child);
assert(child_element != NULL);
const char *included_file = child_element->GetText();
if (included_file != NULL)
{
load(fp.path() + included_file);
}
}
else
{
readXml(fq_node_name, child, fp);
}
}
else if (child->Type() == TiXmlNode::TINYXML_TEXT)
{
insert(fq_node_name, child->Value());
notify(fq_node_name);
}
child = node->IterateChildren(child);
}
}
示例7: onRead
bool Peer::onRead(Exception& ex, FilePath& filePath,DataReader& parameters,DataWriter& properties) {
if(connected)
return _handler.onRead(ex, *this, filePath,parameters,properties);
ERROR("Resource '",filePath.path(),"' access by a not connected client")
return false;
}