diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-10-15 04:13:13 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-10-15 04:13:13 -0300 |
| commit | 7a2358c859dfe5251b709e63f35bc3ed5658e3e2 (patch) | |
| tree | 6d5047bf5a9ee27ed5db5276e0caf69277a0ee16 /src/querymanager.cc | |
| parent | a4b5623497d10febf17231b47d9a1b4cd3c6767d (diff) | |
| download | querymanager-7a2358c859dfe5251b709e63f35bc3ed5658e3e2.tar.gz querymanager-7a2358c859dfe5251b709e63f35bc3ed5658e3e2.zip | |
postgres interval helpers + a few more queries
Diffstat (limited to 'src/querymanager.cc')
| -rw-r--r-- | src/querymanager.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/querymanager.cc b/src/querymanager.cc index 25fdfb2..350b708 100644 --- a/src/querymanager.cc +++ b/src/querymanager.cc @@ -164,6 +164,28 @@ bool StringEqCI(const char *A, const char *B){ } } +bool StringStartsWith(const char *String, const char *Prefix){ + int Index = 0; + while(Prefix[Index] != 0){ + if(String[Index] == 0 || String[Index] != Prefix[Index]){ + return false; + } + Index += 1; + } + return true; +} + +bool StringStartsWithCI(const char *String, const char *Prefix){ + int Index = 0; + while(Prefix[Index] != 0){ + if(String[Index] == 0 || tolower(String[Index]) != tolower(Prefix[Index])){ + return false; + } + Index += 1; + } + return true; +} + bool StringCopyN(char *Dest, int DestCapacity, const char *Src, int SrcLength){ ASSERT(DestCapacity > 0); bool Result = (SrcLength < DestCapacity); |
