Skip to content

Commit

Permalink
Ver 0.0.1.14
Browse files Browse the repository at this point in the history
  さきゅばす変換時に<packet> ... </packet>がないxmlファイルはpacketタグを付加する
  • Loading branch information
nnn-revo2012 committed Dec 15, 2021
1 parent fada596 commit 2caee09
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,4 @@ GNU General Public License v3.0
 xmlファイル出力時絵文字をエンコードしないよう修正(<,>,&,"のみエンコード)
 絵文字変換OFFの場合にエモーションが /emotion ~ のままだったのを修正
 エモーション 雪の絵文字が変わった(雪だるま→結晶)ので修正
 さきゅばす変換時に<packet> ... </packet>のないxmlファイルは前後にpacketタグを付加する
18 changes: 17 additions & 1 deletion comeconv/ConvComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,22 @@ public bool SacXmlConvert(string sfile, string dfile)
using (var sr = new StreamReader(sfile, enc))
using (var sw = new StreamWriter(dfile, true, enc))
{
bool isfirst = true;
bool needpacket = false;
string line;
while (!sr.EndOfStream) // ファイルが最後になるまで順に読み込み
{
line = sr.ReadLine();
if (isfirst)
{
if (line.TrimStart().StartsWith("<chat ") ||
line.TrimStart().StartsWith("<thread "))
{
BeginXmlDoc(sw);
needpacket = true;
}
isfirst = false;
}
if (line.TrimStart().StartsWith("<chat "))
{
while (!line.EndsWith("</chat>"))
Expand All @@ -84,7 +96,7 @@ public bool SacXmlConvert(string sfile, string dfile)
//_form.AddLog("deleted:" + line, 9);
}
}
else if (line.StartsWith("<thread "))
else if (line.TrimStart().StartsWith("<thread "))
{
sw.WriteLine(line);
}
Expand All @@ -93,6 +105,10 @@ public bool SacXmlConvert(string sfile, string dfile)
sw.WriteLine(line);
}
}
if (needpacket)
{
EndXmlDoc(sw);
}
}
}
catch (Exception Ex)
Expand Down
17 changes: 0 additions & 17 deletions comeconv/Prop/Props.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,22 +321,5 @@ public static string GetProviderType(string type)
return result;
}

public static long GetUnixTime() {
return (long)(((TimeSpan)(DateTime.Now - new DateTime(1970, 1, 1))).TotalSeconds);
}

public static DateTime GetUnixToDateTime(long unix) {
DateTime UNIX_EPOCH = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
return UNIX_EPOCH.AddSeconds(unix).ToLocalTime();
}

public static long GetLongParse(string ttt)
{
double dd = -1.0D;
double.TryParse(ttt, out dd);
return (long )dd;

}

}
}

0 comments on commit 2caee09

Please sign in to comment.