---------------------------------------------------------------------
| 943 | } |
| 944 | //--------------------------------------------------------------------- |
| 945 | DataStreamPtr Root::createFileStream(const String& filename, const String& groupName, |
| 946 | bool overwrite, const String& locationPattern) |
| 947 | { |
| 948 | // Does this file include path specifiers? |
| 949 | String path, basename; |
| 950 | StringUtil::splitFilename(filename, basename, path); |
| 951 | |
| 952 | // no path elements, try the resource system first |
| 953 | DataStreamPtr stream; |
| 954 | if (path.empty()) |
| 955 | { |
| 956 | try |
| 957 | { |
| 958 | stream = ResourceGroupManager::getSingleton().createResource( |
| 959 | filename, groupName, overwrite, locationPattern); |
| 960 | } |
| 961 | catch (...) {} |
| 962 | |
| 963 | } |
| 964 | |
| 965 | if (!stream) |
| 966 | { |
| 967 | // save direct in filesystem |
| 968 | stream = _openFileStream(filename, std::ios::out | std::ios::binary); |
| 969 | } |
| 970 | |
| 971 | return stream; |
| 972 | |
| 973 | } |
| 974 | //--------------------------------------------------------------------- |
| 975 | DataStreamPtr Root::openFileStream(const String& filename, const String& groupName) |
| 976 | { |
no test coverage detected