/// <summary> /// Checks if the file with the given suffix and extension exists. /// </summary> /// <param name="file">File</param> /// <param name="suffix">Suffix</param> /// <param name="extension">Extension</param> /// <param name="fileName">Name</param> internal static bool Exists(string file, string suffix, string extension, out string fileName) { string directory = BoogieProgramEmitter.GetDirectoryWithFile(file); fileName = directory + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file) + "_" + suffix + "." + extension; return(File.Exists(fileName)); }
/// <summary> /// Removes the file with the given suffix and extension. /// </summary> /// <param name="file">File</param> /// <param name="suffix">Suffix</param> /// <param name="extension">Extension</param> internal static void Remove(string file, string suffix, string extension) { string directory = BoogieProgramEmitter.GetDirectoryWithFile(file); var fileName = directory + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file) + "_" + suffix; File.Delete(fileName + "." + extension); }
internal static void Emit(List <Declaration> declarations, string file, string suffix, string extension) { string directory = BoogieProgramEmitter.GetDirectoryWithFile(file); var fileName = directory + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(file) + "_" + suffix + "." + extension; using (TokenTextWriter writer = new TokenTextWriter(fileName, true)) { declarations.Emit(writer); } }