read() 공개 메소드

Read from a FStore which provides random access.
public read ( ) : void
리턴 void
예제 #1
0
파일: Nstub.cs 프로젝트: nomit007/f4
        //////////////////////////////////////////////////////////////////////////
        // Stub
        //////////////////////////////////////////////////////////////////////////
        public static void stub(string podName, DirectoryInfo outDir, bool verbose)
        {
            writeLine("    .NET Stub [" + podName + "]");

              string fanHome = SysProps.getProperty("fan.home");
              string podPath = fanHome + "\\lib\\fan\\" + podName + ".pod";
              string target = new FileInfo(outDir + "\\" + podName + ".dll").FullName;

              if (verbose)
              {
            writeLine("  <- " + podPath);
            Pod pod = Pod.doFind(podName, true, null);
            List list = pod.types();
            string pre = "Fan." + FanUtil.upper(podName) + ".";
            for (int i=0; i<list.sz(); i++)
              writeLine("  " + pre + (list.get(i) as Type).name());
            writeLine("  -> " + target);
              }

              FStore store = new FStore(new ZipFile(podPath));
              FPod fpod = new FPod(podName, store);
              fpod.read();
              FTypeEmit.emitPod(fpod, false, target);
        }
예제 #2
0
파일: Pod.cs 프로젝트: nomit007/f4
        public static FPod readFPod(string name)
        {
            FStore store = null;

              // handle sys specially for bootstrapping the VM
              if (name == "sys")
              {
            store = new FStore(new ZipFile(FileUtil.combine(Sys.m_podsDir, name + ".pod")));
              }

              // otherwise delegate to Env.cur to find the pod file
              else
              {
            FileSystemInfo file = null;
            Fan.Sys.File f = Env.cur().findPodFile(name);
            if (f != null) file = ((LocalFile)f).m_file;

            // if null or doesn't exist then its a no go
            if (file == null || !file.Exists) throw UnknownPodErr.make(name).val;

            // verify case since Windoze is case insensitive
            String actualName = file.Name; //getCanonicalFile().getName();
            actualName = actualName.Substring(0, actualName.Length-4);
            if (actualName != name) throw UnknownPodErr.make("Mismatch case: " + name + " != " + actualName).val;

            store = new FStore(new ZipFile(file.FullName));
              }

              // read in the FPod tables
              FPod fpod = new FPod(name, store);
              fpod.read();
              return fpod;
        }