コード例 #1
0
        /// <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));
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        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);
            }
        }