本文整理汇总了C++中std::filebuf::open方法的典型用法代码示例。如果您正苦于以下问题:C++ filebuf::open方法的具体用法?C++ filebuf::open怎么用?C++ filebuf::open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::filebuf
的用法示例。
在下文中一共展示了filebuf::open方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseFile
MeshModel* Loader_3DS::load(const std::string& filename, const Transform& t, int hint)
{
conv_tform = t;
conv = flip_tris = false;
if (conv_tform != Transform()) {
conv = true;
if (conv_tform.m.i.cross(conv_tform.m.j).dot(conv_tform.m.k) < 0)
flip_tris = true;
}
collapse = !!(hint & MeshLoader::HINT_COLLAPSE);
animonly = !!(hint & MeshLoader::HINT_ANIMONLY);
if (!in.open(filename.c_str(), std::ios_base::in | std::ios_base::binary)) {
return 0;
}
MeshModel* root = parseFile();
in.close();
materials_map.clear();
name_map.clear();
id_map.clear();
return root;
}
示例2: pluginLoad
void pluginLoad() {
if(notifyPeriod != 0) {
Environment<>::get().PluginConnector().setNotificationPeriod(this, notifyPeriod);
// Set default resources to log
if (properties.empty()) {
properties.push_back("rank");
properties.push_back("position");
properties.push_back("currentStep");
properties.push_back("cellCount");
properties.push_back("particleCount");
propertyMap["rank"] = true;
propertyMap["position"] = true;
propertyMap["currentStep"] = true;
propertyMap["particleCount"] = true;
propertyMap["cellCount"] = true;
}
else {
for (size_t i = 0; i < properties.size(); ++i) {
propertyMap[properties[i]] = true;
}
}
// Prepare file for output stream
if (streamType == "file") {
size_t rank = static_cast<size_t>(Environment<simDim>::get().GridController().getGlobalRank());
std::stringstream ss;
ss << outputFilePrefix << rank;
boost::filesystem::path resourceLogPath(ss.str());
fileBuf.open(resourceLogPath.string().c_str(), std::ios::out);
}
}
}
示例3: PATH
boost::filesystem::path Appender::DoOpen(std::filebuf &file, Path& path)
{
const boost::filesystem::path PATH(SelectPathToUseHideErrors(path));
CreateDirectoryTree(PATH.branch_path( ));
using namespace std;
file.open(PATH.string( ).c_str( ), ios::out | ios::app | ios::ate);
return PATH;
}
示例4: start
void ImageFileRecorder::start()
{
if ( !m_running )
{
filebuffer.open ( m_logfile.string().c_str(), std::ios::out );
if( !filebuffer.is_open() )
UBITRACK_THROW( "Error opening file" );
m_running = true;
}
}