SIL.Utils.MockFileOS.CreateFileContents C# (CSharp) Method

CreateFileContents() public static method

Create the simulated file contents, suitable for calling MakeFile or AddFile.
public static CreateFileContents ( bool fIncludeBOM, string sBookId ) : string
fIncludeBOM bool Indicates whether file contents should include the byte /// order mark
sBookId string The book id (if set, this will cause \id line to be written /// as the first line of the fiel)
return string
		public static string CreateFileContents(bool fIncludeBOM, string sBookId, params string[] lines)
		{
			StringBuilder bldr = new StringBuilder();
			if (fIncludeBOM)
				bldr.Append("\ufeff");
			if (!String.IsNullOrEmpty(sBookId))
			{
				bldr.Append(@"\id ");
				bldr.AppendLine(sBookId);
			}
			foreach (string sLine in lines)
				bldr.AppendLine(sLine);
			bldr.Length = bldr.Length - Environment.NewLine.Length;

			return bldr.ToString();
		}
		#endregion