public void Init(AFormat format)
    {
        FindFormat find = (FindFormat)format;

        find.n           = 2;
        find.pathInfo    = new PathInfo[2];
        find.pathInfo[0] = new PathInfo("site", 0);
        find.pathInfo[1] = new PathInfo("site/news", 12);
    }
    public void Init(AFormat format)
    {
        XMLFormat xml = (XMLFormat)format;

        xml.SetRoot("site");
        xml.Append(0, new XMLFormat.FileNode {
            id = 12, name = "news"
        });
    }
    public AFormat Transform(AFormat aFormat)
    {
        find = (FindFormat)aFormat;
        xml  = new XMLFormat();
        xml.SetRoot(find.GetPath(0));
        var root = (DirNode)xml.GetNode(0);

        FindSubNodesAndAppend(root, 1, root.name);
        return(xml);
    }
Example #4
0
    public AFormat Transform(AFormat aFormat)
    {
        var     xml  = (XMLFormat)aFormat;
        DirNode root = (DirNode)xml.GetNode(0);

        pathInfo.Add(new PathInfo(root.name, root.id));
        WorkWithSubNodes(root, root.name);
        pathInfo.Sort();
        return(new FindFormat {
            n = pathInfo.Count, pathInfo = pathInfo.ToArray()
        });
    }
Example #5
0
    static void Main(String[] args)
    {
        String  formatName1 = Console.ReadLine(), formatName2 = Console.ReadLine();
        AFormat format = FormatFactory.CreateFormat(formatName1);

        if (formatName1 == formatName2)
        {
            format.Output(new ConsoleOutput());
        }
        else
        {
            format.TransformTo(formatName2).Output(new ConsoleOutput());
        }
    }
Example #6
0
    public void Init(AFormat format)
    {
        FindFormat find = (FindFormat)format;
        String     line = Console.ReadLine();

        find.n        = Convert.ToInt32(line);
        find.pathInfo = new PathInfo[find.n];
        for (Int32 i = 0; i < find.n; i++)
        {
            line = Console.ReadLine();
            String[] s = line.Split(new Char[] { ' ' });
            find.pathInfo[i] = new PathInfo(s[0], Convert.ToInt32(s[1]));
        }
    }
Example #7
0
    public void Init(AFormat format)
    {
        XMLFormat xml = (XMLFormat)format;

        xml.SetRoot("deo");
        xml.Append(0, new XMLFormat.DirNode {
            id = 36, name = "sek"
        });
        xml.Append(0, new XMLFormat.FileNode {
            id = 121, name = "try"
        });
        xml.Append(36, new XMLFormat.DirNode {
            id = 99, name = "uig"
        });
        xml.Append(36, new XMLFormat.FileNode {
            id = 2092, name = "qvg"
        });
        xml.Append(99, new XMLFormat.FileNode {
            id = 370, name = "xoj"
        });
    }
Example #8
0
 public AFormat Transform(AFormat aFormat)
 {
     return(aFormat);
 }
 public void Init(AFormat format)
 {
     ProcessDirectory(format as XMLFormat, 0);
 }
Example #10
0
 public void Output(AFormat aFormat)
 {
     System.Console.Write(aFormat.ToString());
 }