-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* RProjectFile.hpp | ||
* | ||
* Copyright (C) 2009-11 by RStudio, Inc. | ||
* | ||
* This program is licensed to you under the terms of version 3 of the | ||
* GNU Affero General Public License. This program is distributed WITHOUT | ||
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, | ||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the | ||
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. | ||
* | ||
*/ | ||
|
||
#ifndef CORE_R_UTIL_R_PROJECT_FILE_HPP | ||
#define CORE_R_UTIL_R_PROJECT_FILE_HPP | ||
|
||
namespace core { | ||
|
||
class Error; | ||
class FilePath; | ||
|
||
namespace r_util { | ||
|
||
core::Error writeDefaultProjectFile(const FilePath& filePath); | ||
|
||
} // namespace r_util | ||
} // namespace core | ||
|
||
|
||
#endif // CORE_R_UTIL_R_PROJECT_FILE_HPP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* RProjectFile.cpp | ||
* | ||
* Copyright (C) 2009-11 by RStudio, Inc. | ||
* | ||
* This program is licensed to you under the terms of version 3 of the | ||
* GNU Affero General Public License. This program is distributed WITHOUT | ||
* ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, | ||
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the | ||
* AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. | ||
* | ||
*/ | ||
|
||
#include <core/r_util/RProjectFile.hpp> | ||
|
||
#include <core/Error.hpp> | ||
#include <core/FilePath.hpp> | ||
#include <core/FileSerializer.hpp> | ||
|
||
namespace core { | ||
namespace r_util { | ||
|
||
Error writeDefaultProjectFile(const FilePath& filePath) | ||
{ | ||
std::string p; | ||
p = "# R project file\n" | ||
"\n" | ||
"# Run .Rprofile file when loading project (Yes/No)\n" | ||
"RunProfile: Yes\n" | ||
"\n" | ||
"# Restore .RData when loading project (Yes/No)\n" | ||
"RestoreWorkspace: Yes\n" | ||
"\n" | ||
"# Save .RData when closing project (Yes/No/Ask)\n" | ||
"SaveWorkspace: Yes\n" | ||
"\n" | ||
"# Save .Rhistory even when not saving .RData (Yes/No)\n" | ||
"AlwaysSaveHistory: Yes\n"; | ||
|
||
return writeStringToFile(filePath, p); | ||
} | ||
|
||
} // namespace r_util | ||
} // namespace core | ||
|
||
|
||
|