1 // This file is part of Golly.
2 // See docs/License.html for the copyright notice.
3 
4 #ifndef _FILE_H_
5 #define _FILE_H_
6 
7 #include <string>           // for std::string
8 
9 #include "writepattern.h"   // for pattern_format, output_compression
10 
11 // Routines for opening, saving, unzipping, downloading files:
12 
13 void NewPattern(const char* title = "untitled");
14 bool LoadPattern(const char* path, const char* newtitle);
15 void SetPatternTitle(const char* filename);
16 bool SaveCurrentLayer();
17 void CreateUniverse();
18 void OpenFile(const char* path, bool remember = true);
19 bool CopyTextToClipboard(const char* text);
20 bool GetTextFromClipboard(std::string& text);
21 bool SavePattern(const std::string& path, pattern_format format, output_compression compression);
22 const char* WritePattern(const char* path, pattern_format format, output_compression compression,
23                          int top, int left, int bottom, int right);
24 void UnzipFile(const std::string& zippath, const std::string& entry);
25 void GetURL(const std::string& url, const std::string& pageurl);
26 bool DownloadFile(const std::string& url, const std::string& filepath);
27 void ProcessDownload(const std::string& filepath);
28 void LoadLexiconPattern(const std::string& lexpattern);
29 void LoadRule(const std::string& rulestring);
30 std::string GetBaseName(const char* path);
31 
32 #endif
33