Set max file size limit as default parameter for ReadFile

Signed-off-by: srikappa-amzn <srikappa@amazon.com>
This commit is contained in:
srikappa-amzn
2021-09-08 14:29:08 -07:00
parent 1e7af75d94
commit 7bf5894513
2 changed files with 3 additions and 2 deletions
@@ -70,7 +70,8 @@ namespace AZ
//! Parse json text. Returns a failure with error message if the content is not valid JSON.
AZ::Outcome<rapidjson::Document, AZStd::string> ReadJsonString(AZStd::string_view jsonText);
//! Parse a json file. Returns a failure with error message if the content is not valid JSON.
//! Parse a json file. Returns a failure with error message if the content is not valid JSON or if
//! the file size is larger than the max file size provided.
AZ::Outcome<rapidjson::Document, AZStd::string> ReadJsonFile(
AZStd::string_view filePath, size_t maxFileSize = AZStd::numeric_limits<size_t>::max());
+1 -1
View File
@@ -112,6 +112,6 @@ namespace AZ
//! the file size is larger than the max file size provided.
template<typename Container = AZStd::string>
AZ::Outcome<Container, AZStd::string> ReadFile(
AZStd::string_view filePath, size_t maxFileSize);
AZStd::string_view filePath, size_t maxFileSize = AZStd::numeric_limits<size_t>::max());
}
}