当前位置: 首页>>代码示例>>C++>>正文


C++ std::ios类代码示例

本文整理汇总了C++中std::ios的典型用法代码示例。如果您正苦于以下问题:C++ ios类的具体用法?C++ ios怎么用?C++ ios使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ios类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int, char**)
{
    const std::ios ios(0);
    assert(ios.fill() == ' ');

  return 0;
}
开发者ID:ingowald,项目名称:llvm-project,代码行数:7,代码来源:fill.pass.cpp

示例2:

void DenseLinAlgPack::LinAlgPackIO::ios_format_memento::set_format(std::ios& s) const {

  s.flags(flags_);
  s.precision(prec_);
  s.width(wdt_);
  s.fill(fill_);

}
开发者ID:haripandey,项目名称:trilinos,代码行数:8,代码来源:DenseLinAlgPack_IOFormat.cpp

示例3: printstate

void
printstate(const std::ios &ios)
{
    if (ios.good()) {
        std::cout << "ios.good" << std::endl;
    } else if (ios.eof()){
        std::cout << "ios.eof" << std::endl;
    } else if (ios.fail()){
        std::cout << "ios.fail" << std::endl;
    } else if (ios.bad()){
        std::cout << "ios.bad" << std::endl;
    }

}
开发者ID:pp7462-git,项目名称:sandbox,代码行数:14,代码来源:spaccess.cpp

示例4: set_ascii_mode

IO::Mode
set_ascii_mode(std::ios& i)
{
    IO::Mode m = get_mode(i);
    i.iword(IO::mode) = IO::ASCII;
    return m;
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:7,代码来源:io.cpp

示例5: throwIfNotGood

void throwIfNotGood(const std::ios& stream, const std::string& file) {
    if (!stream.good()) {
        std::stringstream ss;
        ss << "Cannot open file " << file;
        throw std::runtime_error(ss.str());
    }
}
开发者ID:milohoffman,项目名称:simple_tar,代码行数:7,代码来源:utils.cpp

示例6: StreamStateSaver

	explicit StreamStateSaver(std::ios &stream)
		: stream(stream)
		, state(nullptr)
	{
		// Save the stream's state.
		state.copyfmt(stream);
	}
开发者ID:GerbilSoft,项目名称:rom-properties,代码行数:7,代码来源:properties.cpp

示例7: set_mode

IO::Mode
set_mode(std::ios& i, IO::Mode m)
{
    IO::Mode old = get_mode(i);
    i.iword(IO::mode) = m;
    return old;
}
开发者ID:FMX,项目名称:CGAL,代码行数:7,代码来源:io.cpp

示例8: set_binary_mode

IO::Mode
set_binary_mode(std::ios& i)
{
    IO::Mode m = get_mode(i);
    i.iword(IO::mode) = IO::BINARY;
    return m;
}
开发者ID:FMX,项目名称:CGAL,代码行数:7,代码来源:io.cpp

示例9: set_pretty_mode

IO::Mode
set_pretty_mode(std::ios& i)
{
    IO::Mode m = get_mode(i);
    i.iword(IO::mode) = IO::PRETTY;
    return m;
}
开发者ID:FMX,项目名称:CGAL,代码行数:7,代码来源:io.cpp

示例10: turnExceptionsOn

void FragmentedFileWriter::turnExceptionsOn(std::ios& stream)
{
	stream.exceptions( std::ios_base::badbit|std::ios_base::failbit);
}
开发者ID:frustreated,项目名称:e2ksniffing,代码行数:4,代码来源:FragmentedFileWriter.cpp

示例11: print_state

//prints the error flags when an attempt to open a file fails
void util::print_state (const std::ios& stream) {
    cerr << " good()=" << stream.good();
    cerr << " eof()=" << stream.eof();
    cerr << " fail()=" << stream.fail();
    cerr << " bad()=" << stream.bad();
}
开发者ID:nunomachado,项目名称:cortex-tool,代码行数:7,代码来源:Util.cpp

示例12: StreamRedirector

 explicit StreamRedirector(std::ios& stream, std::streambuf* newBuf) : savedBuf_(stream.rdbuf()), stream_(stream)
 {
     stream_.rdbuf(newBuf);
 }
开发者ID:delphipka,项目名称:delphipka,代码行数:4,代码来源:app_delphipka.cpp

示例13: print_state

void print_state (const std::ios& stream) {
    std::cout << " good()=" << stream.good();
    std::cout << " eof()=" << stream.eof();
    std::cout << " fail()=" << stream.fail();
    std::cout << " bad()=" << stream.bad();
}
开发者ID:evilbinary,项目名称:lisp-,代码行数:6,代码来源:main.cpp

示例14: show_results

void show_results( std::ios& stm )
{
    std::cout << std::boolalpha << "bad: " << stm.bad() << "   fail: " << stm.fail()
               << "   eof: " << stm.eof() << "   good: " << stm.good()
               << "   bool(stm): " << bool(stm) << "   !stm: " << !stm << '\n' ;
}
开发者ID:CCJY,项目名称:coliru,代码行数:6,代码来源:main.cpp

示例15: is_binary

bool
is_binary(std::ios& i)
{
    return i.iword(IO::mode) == IO::BINARY;
}
开发者ID:FMX,项目名称:CGAL,代码行数:5,代码来源:io.cpp


注:本文中的std::ios类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。