Writing Your Own Task that Uses a FilterChain

jnewton <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nant.user
Message-ID <[email protected]>
I'm trying to write my own "write" task that uses a filterchain. I want to be
able to write to a file (i.e. I am creating an xml file) and replace some
strings in the process using the replacestring filter. I am basing my code
off of the CopyTask but I can't seem to figure out how to use the
PhysicalTextReader class. I am trying the following:

PhysicalTextReader ChainedReader = null;
try
{
    Writer = this.GetWriter();
    Reader = new StringReader(this.Text.Value);
    ChainedReader = new PhysicalTextReader(Reader);
    Filter FilterReader =  this.Filter.GetBaseFilter(ChainedReader);
    while (!false)
    {
        int Focus = FilterReader.Read();
        if (!(Focus > -1))
        {
            break;
        }
        Writer.Write((Char)Focus);
    }
}

However, I can use the PhysicalTextReader due to its protection level. 

Any thoughts?
-- 
View this message in context: http://old.nabble.com/Writing-Your-Own-Task-that-Uses-a-FilterChain-tp28203172p28203172.html
Sent from the NAnt - Users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.