/////////////////////////////////////////////////////////////////////////////// ///////// GENERAL METHODS ///////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// /// <summary> /// Set storage path and define catalog without opening /// Constructor - path to the root folder /// Empty path - in-memory option /// "*" - current directory /// /// Not applicable in 'open' state /// </summary> /// <param name="path"></param> public void Set(string path, string encrypt = "") { if (state == DEFS.STATE_OPENED) { throw new VSException(DEFS.E0025_STORAGE_UNABLE_TO_COMPLETE_CODE, " - 'Set', storage is opened"); } vs_imo = false; string p = (root_path == DEFS.PATH_UNDEFINED) ? path : root_path; root_path = p.Trim(); if (root_path == DEFS.PATH_CURRENT) { root_path = System.IO.Directory.GetCurrentDirectory(); } else if (root_path == "") { vs_imo = true; } else if (root_path == "") { throw new VSException(DEFS.E0032_STORAGE_PATH_UNDEFINED_CODE); } if (CATALOG == null) { CATALOG = new VSCatalog(root_path); } state = DEFS.STATE_DEFINED; if (encrypt.Trim() != "") { this.encrypt = (encrypt.ToUpper().Substring(0, 1) == DEFS.CT_ENCRYPTED); } }
/// <summary> /// Constructor /// </summary> /// <param name="c"></param> public VSCatalogDescriptor(VSCatalog c) { CATALOG = c; }