Add GetExpandedRecordingDirectoryBase
For a path "D:/foo/bar-$Y/$M/$T.flv" this will return at least "D:/foo" (and create "D:/foo" if the directory doesn't exist) or at most "D:/foo/bar-$Y/$M" with $Y and $M expanded, if those directories exist
This commit is contained in:
parent
30e6f7cb30
commit
4e63676d1a
@ -139,6 +139,7 @@ public:
|
||||
};
|
||||
|
||||
String ExpandRecordingFilename(String);
|
||||
String GetExpandedRecordingDirectoryBase(String);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
@ -145,6 +145,27 @@ String ExpandRecordingFilename(String filename)
|
||||
return filename;
|
||||
}
|
||||
|
||||
String GetExpandedRecordingDirectoryBase(String path)
|
||||
{
|
||||
String expanded = path;
|
||||
do
|
||||
{
|
||||
expanded = ExpandRecordingFilename(path);
|
||||
|
||||
if (expanded == path)
|
||||
break;
|
||||
|
||||
if (OSFileIsDirectory(expanded))
|
||||
break;
|
||||
|
||||
path = GetPathDirectory(path);
|
||||
} while (expanded != path);
|
||||
|
||||
CreatePath(expanded);
|
||||
|
||||
return expanded;
|
||||
}
|
||||
|
||||
String GetOutputFilename(bool replayBuffer=false)
|
||||
{
|
||||
String path = OSGetDefaultVideoSavePath(replayBuffer ? L"\\Replay-$T.flv" : L"\\.flv");
|
||||
|
Loading…
x
Reference in New Issue
Block a user