Exemplo n.º 1
0
Arquivo: main.cpp Projeto: CCJY/coliru
void cleanup(std::ios_base::event evt, std::ios_base& str, int idx)
{
    if (str.iword(separatorEnabled()) && evt == std::ios_base::erase_event)
    {
        void*& p = str.pword(idx);
        delete static_cast<std::string*>(p);
        str.iword(separatorEnabled()) = false; 
    }
}
Exemplo n.º 2
0
// Set print_context associated with stream, retain options
static void set_print_context(std::ios_base & s, const print_context & c)
{
	int i = my_ios_index();
	long flags = s.iword(i);
	if (!(flags & callback_registered)) {
		s.register_callback(my_ios_callback, i);
		s.iword(i) = flags | callback_registered;
	}
	print_context *p = static_cast<print_context *>(s.pword(i));
	unsigned options = p ? p->options : c.options;
	delete p;
	p = c.duplicate();
	p->options = options;
	s.pword(i) = p;
}
Exemplo n.º 3
0
void
TimeStreamFormater::setStreamInfo(std::ios_base & theStream) const {
    theStream.iword(ourIsFormatedFlagIndex) = true;
    theStream.pword(ourFormatStringIndex) = (void *) _myFormatString ;
}
Exemplo n.º 4
0
/// Set new flags controlling output.
inline void set_flags(std::ios_base& ios, long new_flags, ios_base_iword_mask mask)
{
  assert((~long(mask) & new_flags) == 0);
  long& flags = ios.iword(detail::xalloc_key_holder<true>::value);
  flags = (flags & ~long(mask)) | new_flags;
}
Exemplo n.º 5
0
/// Get flags controlling output.
inline long get_flags(std::ios_base& ios, ios_base_iword_mask mask)
{ return ios.iword(detail::xalloc_key_holder<true>::value) & long(mask); }