Esempio n. 1
0
        /// <summary>
        /// Stores a file into the Content Managers file, Throws FileNotFoundException if the file doesn't exist. Same effect from using "manager.Write(filePath, entryName, "file")"
        /// </summary>
        /// <param name="entryName">Name to give the entry</param>
        /// <param name="filePath">Path to the file to store</param>
        /// <param name="manager">Content Manager to store the file with</param>
        /// <exception cref="FileNotFoundException">Thrown if "filePath" doesn't point to a file</exception>
        public static void StoreFile(String entryName, String filePath, ref Content_Manager manager)
        {
            if (!File.Exists(filePath))
            {
                throw new FileNotFoundException(filePath + " not found!");
            }

            manager.Write(filePath, entryName, "file");
        }
Esempio n. 2
0
 public static void WriteByteArray(String entryName, byte[] data, ref Content_Manager manager)
 {
     manager.Write(data, entryName, "byteArray");
 }
Esempio n. 3
0
 public static void WriteBool(String entryName, bool data, ref Content_Manager manager)
 {
     manager.Write(data, entryName, "bool");
 }
Esempio n. 4
0
 public static void WriteInt32Array(String entryName, int[] data, ref Content_Manager manager)
 {
     manager.Write(data, entryName, "int32Array");
 }
Esempio n. 5
0
 public static void WriteStringArray(String entryName, String[] data, ref Content_Manager manager)
 {
     manager.Write(data, entryName, "stringArray");
 }
Esempio n. 6
0
 /// <summary>
 /// Takes the data from a file entry/byte array entry and puts it into a file
 /// </summary>
 /// <param name="entryName">Name of the Byte Array/File entry</param>
 /// <param name="filePath">Path to extract the file to</param>
 /// <param name="manager">Content Manager used to read the data file</param>
 public static void ExtractFile(String entryName, String filePath, ref Content_Manager manager)
 {
     File.WriteAllBytes(filePath, manager.Read <byte[]>(entryName));
 }
Esempio n. 7
0
 public static MemoryStream FileEntryToMemoryStream(String entryName, ref Content_Manager manager)
 {
     return(new MemoryStream(manager.Read <byte[]>(entryName)));
 }