コード例 #1
0
        /// <summary>
        /// Create this instance.
        /// </summary>
        public static void Create()
        {
            // save
            PlayerPrefs.SetString (HELLGATE_DB_PATH, sqlitePath);
            PlayerPrefs.SetString (HELLGATE_DB_OUTPUT_PATH, outputJsonPath);
            PlayerPrefs.SetString (HELLGATE_DB_IGNORE_TABLE, ignoreTableName);

            string[] ignores = ignoreTableName.Split (new string[] { ",", "|" }, System.StringSplitOptions.None);

            query = new Hellgate.Query (sqlitePath);

            SqliteMastser[] master = query.SELECT<SqliteMastser> ("type", (object)"table");
            if (master == null) {
                Debug.Log ("There are no tables");
            } else {
                for (int i = 0; i < master.Length; i++) {
                    if (master [i].Name == "sqlite_sequence") {
                        continue;
                    }

                    if (Array.IndexOf (ignores, master [i].Name) >= 0) {
                        continue;
                    }

                    CreateUsalJson (master [i].Name);
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Create this instance.
        /// </summary>
        public static void Create()
        {
            // save
            PlayerPrefs.SetString(HELLGATE_DB_PATH, sqlitePath);
            PlayerPrefs.SetString(HELLGATE_DB_OUTPUT_PATH, outputJsonPath);
            PlayerPrefs.SetString(HELLGATE_DB_IGNORE_TABLE, ignoreTableName);

            string[] ignores = ignoreTableName.Split(new string[] { ",", "|" }, System.StringSplitOptions.None);

            query = new Hellgate.Query(sqlitePath);

            SqliteMastser[] master = query.SELECT <SqliteMastser> ("type", (object)"table");
            if (master == null)
            {
                Debug.Log("There are no tables");
            }
            else
            {
                for (int i = 0; i < master.Length; i++)
                {
                    if (master [i].Name == "sqlite_sequence")
                    {
                        continue;
                    }

                    if (Array.IndexOf(ignores, master [i].Name) >= 0)
                    {
                        continue;
                    }

                    CreateUsalJson(master [i].Name);
                }
            }
        }
コード例 #3
0
        public override void OnSet(object data)
        {
            base.OnSet (data);

            List<object> objs = data as List<object>;
            Dictionary<string, object> intent = Util.GetListObject<Dictionary<string, object>> (objs);

            SetLabelTextValue (title, intent ["title"].ToString ());
            idx = 0;

            query = new Query ("hellgate.db");
            temp.SetActive (false);
        }
コード例 #4
0
        /// <summary>
        /// Create the specified splitFlag and ignores.
        /// </summary>
        /// <param name="splitFlag">If set to <c>true</c> split flag.</param>
        /// <param name="ignores">Ignores.</param>
        public void Create(bool splitFlag, string[] ignores = null)
        {
            this.splitFlag = splitFlag;

            maker = new ExcelImportMaker (excelFilePath);
            IWorkbook book = maker.FileStream ();

            if (book == null) {
                return;
            }

            listSheet = new List<ISheet> ();
            for (int i = 0; i < book.NumberOfSheets; i++) {
                ISheet sheet = book.GetSheetAt (i);
                if (Array.IndexOf (ignores, sheet.SheetName) < 0) {
                    listSheet.Add (sheet);
                }
            }

            if (listSheet.Count <= 0) {
                return;
            }

            path = Path.Combine (dbPath, dbName);
            query = new Query (path);
            query.Sqlite.CreateFile (true);

            stringBuilder = new StringBuilder ();

            index = 0;
            EditorUtil.StartCoroutine (CreateTable ());
        }