Esempio n. 1
0
			std::pair<uint64_t,uint64_t> flush(stream_type & out)
			{
				uint64_t const start = out.tellp();

				if ( pc != pa )
				{
					std::sort(pa,pc);
					out.write(reinterpret_cast<char const *>(pa),(pc-pa)*sizeof(element_type));
					pc = pa;
				}

				uint64_t const end = out.tellp();

				return std::pair<uint64_t,uint64_t>(start,end);
			}
        result_type operator() (stream_type& strm, value_type const& value) const
        {
            if (value.type == attributes::named_scope_entry::function)
            {
                const char* begin = value.scope_name.c_str();
                const char* end = begin + value.scope_name.size();
                if (parse_function_name(begin, end, m_include_scope))
                {
                    strm.write(begin, end - begin);
                    return;
                }
            }

            strm << value.scope_name;
        }
        result_type operator() (stream_type& strm, value_type const& value) const
        {
            std::size_t n = value.file_name.size(), i = n;
            for (; i > 0; --i)
            {
                const char c = value.file_name[i - 1];
#if defined(BOOST_WINDOWS)
                if (c == '\\')
                    break;
#endif
                if (c == '/')
                    break;
            }
            strm.write(value.file_name.c_str() + i, n - i);
        }
Esempio n. 4
0
 /**
     writes the current cached contents to a stream
 */
 template<class stream_type> void to_stream(stream_type & stream) const {
     stream.write( m_str.begin() + m_reserve_prepend, m_str.size() - m_reserve_prepend - m_reserve_append);
 }