using System;
using System.Collections.Generic;
using System.IO ;
namespace 脚本生成程序
{
static public class ProcessASourceFile
{
static private bool IsSpaceChar(char c)
{
return c == ' ' || c == '\t';
}
static private string GetNextWord(string aLine, ref int startIndex)
{
string word = "";
while (startIndex != aLine.Length)
{
if (IsSpaceChar(aLine[startIndex]))
{
if (word == "")
;
else
{
++startIndex;
break;
}
}
else
word += aLine[startIndex];
++startIndex;
}
return word;
}
static private bool IsTheEndOfFile(string aLine)
{
if (aLine == null || aLine == "\n")
return true;
else
return false;
}
static public StreamReader OpenASourceFile(FileInfo fileInfo)
{
StreamReader reader = fileInfo.OpenText();
return reader;
}
static public void LeapfrogExplanation(StreamReader reader)
{
reader.ReadLine();
}
static public bool ReadADataCellSuccessfully(StreamReader reader, ref DataCell sourceDataCell)
{
string aLine = reader.ReadLine();
if (IsTheEndOfFile(aLine))
return false;
int indexOfKeyInfo = 0;
int i = 0;
while (i != aLine.Length)
{
sourceDataCell.SetKeyInfo(indexOfKeyInfo, GetNextWord(aLine, ref i));
++indexOfKeyInfo;
}
return true;
}
static public void CloseASourceFile(StreamReader reader)
{
reader.Close();
}
}
}
脚本生成程序Part2
最新推荐文章于 2025-05-23 20:07:28 发布
1204

被折叠的 条评论
为什么被折叠?



