-#include "lottieloader.h"
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "lottieloader.h"
#include "lottieparser.h"
#include <fstream>
return true;
}
-bool LottieLoader::loadFromData(const char *jsonData, const char *key)
+bool LottieLoader::loadFromData(std::string &&jsonData, const std::string &key)
{
LottieFileCache &fileCache = LottieFileCache::get();
- std::string keyString(key);
- mModel = fileCache.find(std::string(keyString));
+ mModel = fileCache.find(key);
if (mModel) return true;
- LottieParser parser(const_cast<char *>(jsonData));
+ LottieParser parser(const_cast<char *>(jsonData.c_str()));
mModel = parser.model();
- fileCache.add(keyString, mModel);
+ fileCache.add(key, mModel);
return true;
}