JsonFiles to sublib

This commit is contained in:
2015-04-28 09:59:58 +02:00
parent 5b90d12efd
commit 83b91ab8fc
3 changed files with 163 additions and 101 deletions

View File

@ -15,6 +15,7 @@ namespace CobXmlSupport
private string __filePathId;
private string __fileId;
private string __pathId;
private string __jsonPathId;
private string __ccFileInId;
private string __ccFileOutId;
private string __ccFileInIdNoSuff;
@ -27,13 +28,14 @@ namespace CobXmlSupport
__filePathId = "";
__fileId = "";
__pathId = "";
__jsonPathId = "";
__ccFileInId = "";
__ccFileOutId = "";
__ccFileInIdNoSuff = "";
__ccFileOutIdNoSuff = "";
}
public codeCompleter(string pathFileId,string fpref)
public codeCompleter(string pathFileId, string fpref)
{
__FieldPrefix = fpref;
__filePathId = pathFileId;
@ -42,6 +44,15 @@ namespace CobXmlSupport
__wrkDicOut = new Dictionary<string, string>();
}
public string jsonPathId
{
get
{
return __jsonPathId;
}
}
public string FilePathId
{
set
@ -85,8 +96,15 @@ namespace CobXmlSupport
private void nameCreator(string inPathFname)
{
string gPrefix = "." + __FieldPrefix.Replace("_", "").Trim();
__fileId = inPathFname.Substring(inPathFname.LastIndexOf("\\") + 1);
__pathId = inPathFname.Substring(0, inPathFname.LastIndexOf("\\") + 1);
if (Directory.Exists(__pathId + @"JsonExt\")) { }
else
{
Directory.CreateDirectory(__pathId + @"JsonExt\");
}
__jsonPathId = __pathId + @"JsonExt\";
__ccFileInId = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".In" + gPrefix + JSON;
__ccFileOutId = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".Out" + gPrefix + JSON;
__ccFileInIdNoSuff = __fileId.Substring(0, __fileId.LastIndexOf(".")) + ".In" + gPrefix;
@ -116,7 +134,7 @@ namespace CobXmlSupport
public void TryFill_In_Dic()
{
string ccFileInId = __pathId + __ccFileInId;
string ccFileInId = __jsonPathId + __ccFileInId;
if (__filePathId.Trim() == "") { }
else
{
@ -130,7 +148,7 @@ namespace CobXmlSupport
public void TryFill_Out_Dic()
{
string ccFileOutId = __pathId + __ccFileOutId;
string ccFileOutId = __jsonPathId + __ccFileOutId;
if (__filePathId.Trim() == "") { }
else
{
@ -152,13 +170,13 @@ namespace CobXmlSupport
public void Save_In_Dic()
{
string ccFileInId = __pathId + __ccFileInId;
if (Directory.Exists(__pathId + @"\JsonBackup\")) { }
string ccFileInId = __jsonPathId + __ccFileInId;
if (Directory.Exists(__jsonPathId + @"\JsonBackup\")) { }
else
{
Directory.CreateDirectory(__pathId + @"\JsonBackup\");
Directory.CreateDirectory(__jsonPathId + @"\JsonBackup\");
}
string ccFileInBackup = __pathId +@"\JsonBackup\"+ __ccFileInIdNoSuff + backupSuffix();
string ccFileInBackup = __jsonPathId + @"\JsonBackup\" + __ccFileInIdNoSuff + backupSuffix();
if (__filePathId.Trim() == "") { }
else
@ -177,13 +195,13 @@ namespace CobXmlSupport
public void Save_Out_Dic()
{
string ccFileOutId = __pathId + __ccFileOutId;
if (Directory.Exists(__pathId + @"\JsonBackup\")) { }
string ccFileOutId = __jsonPathId + __ccFileOutId;
if (Directory.Exists(__jsonPathId + @"\JsonBackup\")) { }
else
{
Directory.CreateDirectory(__pathId + @"\JsonBackup\");
Directory.CreateDirectory(__jsonPathId + @"\JsonBackup\");
}
string ccFileOutBackup = __pathId + @"\JsonBackup\" + __ccFileOutIdNoSuff + backupSuffix();
string ccFileOutBackup = __jsonPathId + @"\JsonBackup\" + __ccFileOutIdNoSuff + backupSuffix();
if (__filePathId.Trim() == "") { }
else