本文整理汇总了C++中path_t::chars方法的典型用法代码示例。如果您正苦于以下问题:C++ path_t::chars方法的具体用法?C++ path_t::chars怎么用?C++ path_t::chars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类path_t
的用法示例。
在下文中一共展示了path_t::chars方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: target_path
virtual int copy_file_to_hash
(const entry_t& source, const path_t& target, hash_t& hash) {
entry_t& entry = target_entry_;
string_t target_path(target.chars());
const char_t* chars = 0;
int err = 1;
if ((append_hash_name_to_target_path_) && (chars = hash.name())) {
target_path.append(&target.extension_separator(), 1);
target_path.append(hash_name_prefix_);
target_path.append(chars);
target_path.append(hash_name_suffix_);
}
if ((entry.exists(chars = target_path.chars()))) {
if ((write_overwrite != write_) && (write_append != write_)) {
errf("target file \"%s\" already exists\n", chars);
} else {
fs::entry_type type = fs::entry_type_none;
switch (type = entry.type()) {
case fs::entry_type_file:
err = copy_file_to_file_hash(source, entry, hash);
break;
default:
break;
}
}
} else {
if (!(err = make_directory(entry, target))) {
entry.set_path(chars);
err = copy_file_to_file_hash(source, entry, hash);
} else {
errf("failed to make directory \"%s\"\n", target.directory().chars());
}
}
if (!(err) && (!(to_same != to_) || !(target_modified_))) {
if ((entry.set_times_to_set(source))) {
if ((entry.set_times_set())) {
} else {
}
}
}
return err;
}
示例2: path
virtual int make_directories
(const sub_directories_t& sub_directories, const entry_t& entry, const path_t& path) {
int err = 0;
sub_directories_t::const_iterator end = sub_directories.end();
sub_directories_t::const_iterator i;
for (i = sub_directories.begin(); i != end; ++i) {
const sub_directory_t& d = *i;
string_t path(d.chars, d.length);
EV_LOG_MESSAGE_INFO("make directory \"" << path << "\"...");
if ((entry.make_directory(path.chars()))) {
EV_LOG_MESSAGE_INFO("...made directory \"" << path << "\"");
} else {
EV_LOG_MESSAGE_INFO("...failed to make directory \"" << path << "\"");
return 1;
}
}
return err;
}
示例3: copy
virtual int copy(const path_t& source, const path_t& target) {
entry_t& entry = source_entry_;
const char_t* chars = 0;
int err = 0;
if ((entry.exists(chars = source.chars()))) {
fs::entry_type type = fs::entry_type_none;
switch (type = entry.type()) {
case fs::entry_type_file:
err = copy_file(entry, target);
break;
default:
break;
}
} else {
errf("source file \"%s\" does not exist\n", chars);
err = 1;
}
return err;
}
示例4: copy_file
virtual int copy_file(const entry_t& source, const path_t& target) {
entry_t& entry = target_entry_;
const char_t* chars = 0;
int err = 1;
if ((entry.exists(chars = target.chars()))) {
if ((write_overwrite != write_) && (write_append != write_)) {
errf("target file \"%s\" already exists\n", chars);
} else {
fs::entry_type type = fs::entry_type_none;
switch (type = entry.type()) {
case fs::entry_type_file:
err = copy_file_to_file(source, entry);
break;
default:
break;
}
}
} else {
if (!(err = make_directory(entry, target))) {
entry.set_path(chars);
err = copy_file_to_file(source, entry);
} else {
errf("failed to make directory \"%s\"\n", target.directory().chars());
}
}
if (!(err) && (!(to_same != to_) || !(target_modified_))) {
if ((entry.set_times_to_set(source))) {
if ((entry.set_times_set())) {
} else {
}
}
}
return err;
}