Пример #1
0
 //template <typename T>
 public input_context(istream_uptr istrm, string local_path, string name) //input_context(T &&istrm, const pstring &local_path, const pstring &name)
 {
     m_reader     = new StreamReader(istrm.release_stream());             //: m_reader(std::forward<T>(istrm))
     m_lineno     = 0;
     m_local_path = local_path;
     m_name       = name;
 }
Пример #2
0
        //PCOPYASSIGNMOVE(ppreprocessor, delete)

        //~ppreprocessor() = default;


        /// \brief process stream
        ///
        /// \param filename a filename or identifier identifying the stream.
        ///
        /// FIXME: this is sub-optimal. Refactor input_context into pinput_context
        /// and pass this to ppreprocessor.
        ///
        //template <typename T>
        public string process(istream_uptr istrm, string filename)  //pstring process(T &&istrm, const pstring &filename)
        {
            m_outbuf = m_outbuf.clear_();
            m_stack.emplace_back(new input_context(istrm, plib.util.path(filename), filename));  //m_stack.emplace_back(input_context(istrm.release_stream(),plib::util::path(filename), filename));
            process_stack();
            return(m_outbuf);
        }