Esempio 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());
 }
Esempio 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());
 }
Esempio 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;
        }
Esempio 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));
            }
        }
Esempio n. 5
0
        //////////////////////////////////////////////////////////////////////////
        // Static
        //////////////////////////////////////////////////////////////////////////

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