From 7a2358c859dfe5251b709e63f35bc3ed5658e3e2 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Wed, 15 Oct 2025 04:13:13 -0300 Subject: postgres interval helpers + a few more queries --- src/querymanager.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/querymanager.cc') 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); -- cgit v1.2.3