本文整理汇总了C++中FileName::fullPath方法的典型用法代码示例。如果您正苦于以下问题:C++ FileName::fullPath方法的具体用法?C++ FileName::fullPath怎么用?C++ FileName::fullPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileName
的用法示例。
在下文中一共展示了FileName::fullPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: out
bffilebuf::bffilebuf(const FileName &filename, ios::openmode mode) :
in(0), out(0), readbuf(0), writebuf(0), remaining(0), num(0)
{
if (mode & ios::in) {
remaining = FileWriter::getFileSize(filename) - strlen(BF_FILE_IDENTIFICATOR) - 1;
in = new FileUtils::paloifstream(filename.fullPath().c_str());
string ident;
getline(*in, ident);
if (ident == BF_FILE_IDENTIFICATOR) {
readbuf = new unsigned char[BUF_SIZE];
setg((char *)readbuf, (char *)readbuf, (char *)readbuf);
} else {
delete in;
in = 0;
}
}
if (mode & ios::out) {
size_t s = FileWriter::getFileSize(filename);
out = new FileUtils::paloofstream(filename.fullPath().c_str(), mode);
if (!(s && (mode & ios::app))) {
*out << BF_FILE_IDENTIFICATOR << endl;
}
writebuf = new unsigned char[BUF_SIZE];
setp((char *)writebuf, (char *)(writebuf + BUF_SIZE - 1));
}
memcpy(ivec, &initivec, 8);
BF_set_key(&key, (int)passphrase.size(), (const unsigned char *)passphrase.c_str());
}
示例2: isReadable
bool FileUtils::isReadable(const FileName& fileName) {
FILE* file = fopen(fileName.fullPath().c_str(), "r");
if (file == 0) {
return false;
} else {
fclose(file);
return true;
}
}
示例3: rename
bool FileUtils::rename(const FileName& oldName, const FileName& newName) {
int result = std::rename(oldName.fullPath().c_str(),
newName.fullPath().c_str());
return (result != 0) ? false : true;
}
示例4: remove
bool FileUtils::remove(const FileName& fileName) {
int result = std::remove(fileName.fullPath().c_str());
return (result != 0) ? false : true;
}