Exemplo n.º 1
0
 public File createFile(string name)
 {
     if (!isDir())
     {
         throw IOErr.make("Not a directory: " + this).val;
     }
     return(this.plus(FanStr.toUri(name)).create());
 }
Exemplo n.º 2
0
 public File createDir(string name)
 {
     if (!isDir())
     {
         throw IOErr.make("Not a directory: " + this).val;
     }
     if (!name.EndsWith("/"))
     {
         name = name + "/";
     }
     return(this.plus(FanStr.toUri(name)).create());
 }
Exemplo n.º 3
0
        public string toLocale(string pattern)
        {
            if (pattern == null)
            {
                return(localeAbbr());
            }
            if (FanStr.isEveryChar(pattern, 'W'))
            {
                switch (pattern.Length)
                {
                case 3: return(localeAbbr());

                case 4: return(localeFull());
                }
            }
            throw ArgErr.make("Invalid pattern: " + pattern).val;
        }
Exemplo n.º 4
0
        static void pods(String progName)
        {
            version(progName);

            long t1   = Duration.nowTicks();
            List pods = Pod.list();
            long t2   = Duration.nowTicks();

            writeLine("");
            writeLine("Fantom Pods [" + (t2 - t1) / 1000000L + "ms]:");

            writeLine("  Pod                 Version");
            writeLine("  ---                 -------");
            for (int i = 0; i < pods.sz(); ++i)
            {
                Pod pod = (Pod)pods.get(i);
                writeLine("  " +
                          FanStr.justl(pod.name(), 18L) + "  " +
                          FanStr.justl(pod.version().toStr(), 8));
            }
        }
Exemplo n.º 5
0
        //////////////////////////////////////////////////////////////////////////
        // Static
        //////////////////////////////////////////////////////////////////////////

        public static object decode(string s)
        {
            return(new ObjDecoder(FanStr.@in(s), null).readObj());
        }
Exemplo n.º 6
0
 public override long hash()
 {
     return(FanStr.hash(signature()));
 }