Skip to content
/ tocase Public

Convert case of unicode paths recursivly to lower/upper/title/foldcase

License

Notifications You must be signed in to change notification settings

jopadan/tocase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tocase

single-file header-only recursive unicode path case convert using icu

Downloading

git clone --recurse-submodules --recursive http:https://github.com/jopadan/tocase

Dependencies

Building

cmake . --install-prefix=[prefix] && make install

Example

mkdir -p FoE/DsAseE/dfRe.dESDf && touch FoE/DsAseE/dfRe.dESDf/fEe.ReE
tocase -c lower FoE/DsAseE/dfRe.dESDf
tocase -r -c lower FoE && rm -rf foe

Usage

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include "tocase.h"

using namespace std;
using namespace std::filesystem;

path src = argv[1];
case_mode mode = case_mode_from_str["lower"];
traverse_mode traverse = traverse_mode::recursive;

/* rename path and all of its contents recursively */
src = tocase(src, mode, traverse_moode::recursive);
cout << src << std::endl;

/* rename only path and none of its contents */
src = tocase(src, mode, traverse_mode::none);
cout << src << std::endl;
g++ -std=gnu++23 -I<location of directory including tocase.h> <file.cpp> -licuuc

Credits

Jon Daniel [email protected]