コード例 #1
0
        public void init(string dir, md5_log_keeper.md5_type prefer)
        {
            // only call once!
            Debug.Assert(sett_ == null);
            try {
                dir = new DirectoryInfo(dir).FullName;
                Directory.CreateDirectory(dir);
            } catch (Exception e) {
                logger.Fatal("[md5] can't init notes keeper " + dir + " : " + e.Message);
            }

            dir_ = dir;
            prefer_md5_method_ = prefer;
            sett_ = new settings_file(dir + "\\notes.txt");

            int count = int.Parse(sett_.get("file_count", "0"));

            for (int i = 0; i < count; ++i)
            {
                string md5  = sett_.get("file." + i + ".md5");
                string file = sett_.get("file." + i + ".name");
                if (md5 != "" && file != "")
                {
                    md5_to_notes_file_.Add(md5, file);
                }
            }
        }
コード例 #2
0
 public void init(settings_file sett_file)
 {
     Debug.Assert(sett_ == null);
     sett_ = sett_file;
     load();
     ++run_count;
 }
コード例 #3
0
        public void init(string dir, md5_log_keeper.md5_type prefer) {
            // only call once!
            Debug.Assert(sett_ == null);
            try {
                dir = new DirectoryInfo(dir).FullName;
                Directory.CreateDirectory(dir);
            } catch(Exception e) {
                logger.Fatal("[md5] can't init notes keeper " + dir + " : " + e.Message);
            }

            dir_ = dir;
            prefer_md5_method_ = prefer;
            sett_ = new settings_file(dir + "\\notes.txt");

            int count = int.Parse(sett_.get("file_count", "0"));
            for (int i = 0; i < count; ++i) {
                string md5 = sett_.get("file." + i + ".md5");
                string file = sett_.get("file." + i + ".name");
                if ( md5 != "" && file != "")
                    md5_to_notes_file_.Add(md5, file);
            }
        }