Ejemplo n.º 1
0
            public virtual cape.File next()
            {
                string str = null;

                try {
                    if (it == null)
                    {
                        return(null);
                    }
                    if (it.MoveNext() == false)
                    {
                        return(null);
                    }
                    str = it.Current as string;
                    if (str == null)
                    {
                        return(null);
                    }
                    str = System.IO.Path.Combine(completePath, str);
                }
                catch (System.Exception e) {
                    file.onError(e.ToString());
                    return(null);
                }
                var v = new cape.FileForDotNet();

                v.setCompletePathRaw(str);
                return((cape.File)v);
            }
Ejemplo n.º 2
0
        public static cape.File forPath(string path)
        {
            var v = new cape.FileForDotNet();

            v.setCompletePath(path);
            return((cape.File)v);
        }
Ejemplo n.º 3
0
        public override cape.File withExtension(string ext)
        {
            if (!(ext != null))
            {
                return((cape.File) this);
            }
            var v = new cape.FileForDotNet();

            if (completePath != null)
            {
                v.setCompletePathRaw(completePath + "." + ext);
            }
            return((cape.File)v);
        }
Ejemplo n.º 4
0
        public override cape.File entry(string name)
        {
            onError(null);
            if (object.Equals(name, null) || cape.String.getLength(name) < 1)
            {
                return((cape.File) this);
            }
            var v = new cape.FileForDotNet();

            if (object.Equals(completePath, null))
            {
                v.setCompletePath(name);
            }
            else
            {
                v.setCompletePathRaw(System.IO.Path.Combine(completePath, name));
            }
            return((cape.File)v);
        }
Ejemplo n.º 5
0
        public override cape.File getParent()
        {
            onError(null);
            string v = null;

            if (completePath != null)
            {
                var di = System.IO.Directory.GetParent(completePath);
                if (di != null)
                {
                    v = di.FullName;
                }
            }
            if (v == null)
            {
                v = completePath;
            }
            var r = new cape.FileForDotNet();

            r.setCompletePathRaw(v);
            return((cape.File)r);
        }
Ejemplo n.º 6
0
 public cape.FileForDotNet.MyFileReader setFile(cape.FileForDotNet v)
 {
     file = v;
     return(this);
 }
Ejemplo n.º 7
0
 public cape.FileForDotNet.MyIterator setFile(cape.FileForDotNet v)
 {
     file = v;
     return(this);
 }