Open st-AR-gazer opened 1 month ago
String:
NthIndexOf
, NthLastIndexOf
: I'm not sure these are going to be super useful for most applications, but I can add it. What use-case have you used these for?LastIndexOf
is already implemented for the next update.IO:
Move
already handles directories - what do you expect a recursive
parameter to do?Rename
is the same as Move
, what different do you expect this to do?FileCreatedTime
is already implemented for the next update, see #521.Json:
pretty
parameter for Json::Write()
and Json::ToFile()
is already implemented for the next update.I currently have no use for NthIndexOf (I do remember needing it at one point though, iirc it was some movement through directories, though it was a litte while back so I don't fully remember at this point...). I'm using NthLastIndexOf for moving between different directories, as well as getting the type of gbx file e.g filename.Replay.Gbx, using NthLastIndexOf makes getting the "relplay" (or any other 'type' for that matter) a lot easier.
The recursive parameter would create the path input into the 'move' if it didn't already exist.
I didn't think of using move as a rename function, should work, I think.
FileCreatedTime
nice!
And the PrettyPrint
json is also nice!
I did not think you meant a recursive
parameter on IO::Move
to create directories. I'm not sure it's appropriate to have a parameter like that. Instead, you could use IO::CreateFolder
and Path::GetDirectoryName
to achieve this pretty easily:
string pathSource = "file.wav";
string pathTarget = "some/directory/file.wav";
IO::CreateDirectory(Path::GetDirectoryName(pathTarget));
IO::Move(pathSource, pathTarget);
Ah, yes that makes sense 👍
Heyo Miss, I've made quite a few custom functions over the past while and I though I should finally sit down and a short list of some functions/improvements to existing functions that it'd be nice to have in Openplanet :D
So, lets get started: (Most of these can be found in arUtils)
class string NthIndexOf (gets the Nth index of a character, needs (string value, int n))). LastIndexOf (gets the last index of a character, needs (string value)). NthLastIndexOf (gets the Nth last index of a character, needs (string value, int n)).
namespace IO Move (should get a 'recursive' parameter). Rename (should exist, having to read a file to end, and then re-write it in a different location is not good...) FileCreatedDate (I'm currently getting this with a dll, which isn't exactly ideal... It'd be amazing if this could be added as well :))
namespace Json PrettyPrint (pretty prints a Json::Value).
And yeah, that's about it :) I have more utility functions, but I don't think they really fit in Openplanet, though, if I come across any more functions I think need adding I'll setup another issue (or maybe add to this one, idk what is best xD)