23 #include "../libsheepyObject.h" 27 #define internal static 136 self->type =
"smallBool";
145 self->f = smallBoolF;
202 #if (recycleContainers) 220 #if (recycleContainers) 288 if (self->value->value) {
289 return(strdup(
"true"));
292 return(strdup(
"false"));
313 #if (NFreeStackCheck) 316 register u64 rsp
asm(
"rsp");
317 if ((
u64)*
self > rsp) {
318 logW(
"Probably trying to free a smallBool on stack: "BLD PRIx64
RST" sp: "BLD PRIx64
RST, *
self, rsp);
322 #if (recycleContainers) 336 #if (recycleContainers) 358 return(self->value->value);
367 self->value->value =
value;
383 self->value->value =
value;
399 self->value->value =
value;
415 self->value->value =
value;
431 self->value->value =
value;
447 self->value->value =
value;
467 self->value->value =
value;
479 value = p2->
f->get(p2);
485 self->value->value =
value;
497 double r = p2->
f->get(p2);
506 self->value->value =
value;
518 int64_t
r = p2->
f->get(p2);
527 self->value->value =
value;
540 if (!type ||
eqS(type,
"undefined") ||
eqS(type,
"dict") ||
eqS(type,
"array")) {
544 if (
eqS(type,
"bool")) {
547 else if (
eqS(type,
"double")) {
550 else if (
eqS(type,
"int")) {
553 else if (
eqS(type,
"string")) {
575 self->value->value =
value;
585 return(&(self->value->value));
590 if (!self->value || !p2) {
595 return(self->value->value);
597 else if (
strEq(p2,
"false") ||
strEq(p2,
"FALSE")) {
598 return(!self->value->value);
605 if (!self->value || !p2) {
613 return(self->value->value);
615 else if (
strEq(s,
"false") ||
strEq(s,
"FALSE")) {
617 return(!self->value->value);
629 return(self->value->value == p2);;
638 return(self->value->value == p2);;
647 return(self->value->value == p2);;
656 return(self->value->value == p2);;
665 return(self->value->value == p2);;
674 return(self->value->value == p2);;
679 if (!self->value || !p2 || !p2->
value) {
683 return(self->value->value == p2->
value->
value);;
688 if (!self->value || !p2 || !p2->
B) {
693 return(self->value->value);
696 return(!self->value->value);
703 if (!self->value || !p2 || !p2->
value) {
707 return(self->value->value == p2->
value->
value);;
712 if (!self->value || !p2 || !p2->
value) {
716 return(self->value->value == p2->
value->
value);;
730 return(p2->
f->equalSmallBool(p2,
self));
735 if (!self->value || !p2 || !p2->
data) {
741 return(self->value->value);
743 else if (
strEq(s,
"false") ||
strEq(s,
"FALSE")) {
744 return(!self->value->value);
754 if (!filePath ||
isBlankS(filePath)) {
762 f = fopen(filePath,
"r");
765 shEPrintfS(
"The path was: \"%s\"\n", filePath);
768 readStatus = fread(&self->value->value, 1,
sizeof(
bool) , f);
771 if (readStatus !=
sizeof(
bool)) {
773 shEPrintfS(
"The path was: \"%s\"\n", filePath);
792 if (!
eqS(type,
"string")) {
824 readStatus = fread(&self->value->value, 1,
sizeof(
bool) , fp);
826 if (readStatus !=
sizeof(
bool)) {
839 if (!filePath ||
isBlankS(filePath) || !self->value) {
843 f = fopen(filePath,
"w");
846 shEPrintfS(
"The path was: \"%s\"\n", filePath);
849 writeStatus = fwrite(&self->value->value, 1,
sizeof(
bool) , f);
852 if (writeStatus !=
sizeof(
bool)) {
854 shEPrintfS(
"The path was: \"%s\"\n", filePath);
873 if (!
eqS(type,
"string")) {
897 if (!fp || !self->value) {
901 writeStatus = fwrite(&self->value->value, 1,
sizeof(
bool) , fp);
903 if (writeStatus !=
sizeof(
bool)) {
916 if (!filePath ||
isBlankS(filePath) || !self->value) {
920 f = fopen(filePath,
"a");
923 shEPrintfS(
"The path was: \"%s\"\n", filePath);
926 writeStatus = fwrite(&self->value->value, 1,
sizeof(
bool) , f);
929 if (writeStatus !=
sizeof(
bool)) {
931 shEPrintfS(
"The path was: \"%s\"\n", filePath);
951 return(self->f->duplicate(
self));
958 return(self->f->get(
self));
963 return(self->f->getP(
self));
968 return(self->f->set(
self, p2));
973 return(self->f->setDouble(
self, p2));
978 return(self->f->setInt64(
self, p2));
983 return(self->f->setInt32(
self, p2));
988 return(self->f->setUint32(
self, p2));
993 return(self->f->setUint64(
self, p2));
998 return(self->f->setS(
self, p2));
1003 return(self->f->setSmallBool(
self, p2));
1008 return(self->f->setSmallDouble(
self, p2));
1013 return(self->f->setSmallInt(
self, p2));
1018 return(self->f->setSmallJson(
self, p2));
1023 return(self->f->setSmallString(
self, p2));
1029 return(self->f->equalChar(
self, p2));
1034 return(self->f->equalBase(
self, p2));
1039 return(self->f->equalBool(
self, p2));
1044 return(self->f->equalDouble(
self, p2));
1049 return(self->f->equalInt64(
self, p2));
1054 return(self->f->equalInt32(
self, p2));
1059 return(self->f->equalUint32(
self, p2));
1064 return(self->f->equalUint64(
self, p2));
1069 return(self->f->equal(
self, p2));
1074 return(self->f->equalSmallBytes(
self, p2));
1079 return(self->f->equalSmallDouble(
self, p2));
1084 return(self->f->equalSmallInt(
self, p2));
1089 return(self->f->equalSmallJson(
self, p2));
1094 return(self->f->equalSmallString(
self, p2));
1099 return(self->f->readFile(
self, filePath));
1104 return(self->f->readFileSmallJson(
self,filePath));
1109 return(self->f->readFileSmallString(
self,filePath));
1114 return(self->f->readStream(
self, fp));
1119 return(self->f->writeFile(
self, filePath));
1124 return(self->f->writeFileSmallJson(
self,filePath));
1129 return(self->f->writeFileSmallString(
self,filePath));
1134 return(self->f->writeStream(
self, fp));
1139 return(self->f->appendFile(
self, filePath));
1144 return(self->f->appendFileSmallString(
self,filePath));
#define getTopDoubleO(self)
internal void terminateSmallBool(smallBoolt **self)
#define getTopBoolO(self)
bool eqS(const char *string1, const char *string2)
string Equal compare string1 to string2
bool isBlankS(const char *string)
is Blank String
smallBoolt * readFileSmallJsonSmallBoolG(smallBoolt *self, smallJsont *filePath)
internal int appendFileSmallBool(smallBoolt *self, const char *filePath)
internal bool * getPSmallBool(smallBoolt *self)
void cleanUpSmallBoolFreeG(smallBoolt **val)
internal smallBoolt * setInt32SmallBool(smallBoolt *self, int32_t p2)
int writeFileSmallStringSmallBoolG(smallBoolt *self, smallStringt *filePath)
#define ssGet(obj)
get a pointer to the string in the smallString object
void registerMethodsSmallBool(smallBoolFunctionst *f)
#define RST
reset for color function
smallBoolt * setSmallBoolG(smallBoolt *self, bool p2)
internal smallBoolt * setSmallBool(smallBoolt *self, bool value)
internal bool equalSmallBoolSmallString(smallBoolt *self, smallStringt *p2)
smallBoolt * allocSmallBool(bool value)
bool equalSmallBoolInt32G(smallBoolt *self, int32_t p2)
internal char * toStringSmallBool(smallBoolt *self)
int appendFileSmallStringSmallBoolG(smallBoolt *self, smallStringt *filePath)
internal smallBoolt * setSSmallBool(smallBoolt *self, const char *p2)
internal smallBoolt * setSmallBoolSmallBool(smallBoolt *self, smallBoolt *p2)
#define helpTextSmallBool
help text for this class It is public declaration so that child classes can add their help text easil...
internal bool equalSmallBoolInt64(smallBoolt *self, int64_t p2)
#define pFuncError
print function name and system error
bool equalSmallBoolFG(smallBoolt *self, smallBoolt *p2)
internal bool equalSmallBoolBool(smallBoolt *self, bool p2)
internal smallBoolt * setUint32SmallBool(smallBoolt *self, uint32_t p2)
terminateSmallBoolFt terminate
internal bool equalSmallBoolChar(smallBoolt *self, const char *p2)
#define createAllocateSmallBool(obj)
internal const char * helpSmallBool(smallBoolt UNUSED *self)
#define isError(assigned, left)
is Assigment Error catch error when assigned is false, 0 or NULL after being assigned with left ...
bool equalSmallBoolBaseG(smallBoolt *self, baset *p2)
bool equalSmallBoolSmallDoubleG(smallBoolt *self, smallDoublet *p2)
bool * getBoolPSmallBoolG(smallBoolt *self, bool *retType UNUSED, int64_t index UNUSED)
void cleanUpSmallBoolFreeLocalG(smallBoolt *val)
internal bool getSmallBool(smallBoolt *self)
char * sStringGetTiny(sStringt *string)
get string in a small string object
internal smallBoolt * readFileSmallJsonSmallBool(smallBoolt *self, smallJsont *filePath)
internal int writeFileSmallStringSmallBool(smallBoolt *self, smallStringt *filePath)
internal int writeFileSmallBool(smallBoolt *self, const char *filePath)
smallBoolt * setUint64SmallBoolG(smallBoolt *self, uint64_t p2)
bool getBoolSmallBoolG(smallBoolt *self, bool retType UNUSED, int64_t index UNUSED)
#define getTopTypeO(self)
#define isOSmallJson(obj)
test if obj type is smallJson
internal smallBoolt * readStreamSmallBool(smallBoolt *self, FILE *fp)
internal bool equalSmallBoolSmallInt(smallBoolt *self, smallIntt *p2)
internal smallBoolt * setSmallDoubleSmallBool(smallBoolt *self, smallDoublet *p2)
#define terminateO(obj)
free buffers and obj itself
internal smallBoolt * setSmallIntSmallBool(smallBoolt *self, smallIntt *p2)
internal bool equalSmallBoolUint32(smallBoolt *self, uint32_t p2)
int writeFileSmallBoolG(smallBoolt *self, const char *filePath)
internal void smashSmallBool(smallBoolt **self)
bool equalSmallBoolSmallIntG(smallBoolt *self, smallIntt *p2)
smallBoolt * readFileSmallStringSmallBoolG(smallBoolt *self, smallStringt *filePath)
bool equalSmallBoolInt64G(smallBoolt *self, int64_t p2)
bool equalSmallBoolCharG(smallBoolt *self, const char *p2)
smallBoolt * setSmallStringSmallBoolG(smallBoolt *self, smallStringt *p2)
internal bool equalSmallBoolDouble(smallBoolt *self, double p2)
void initiateSmallBool(smallBoolt *self)
smallBoolt * setUint32SmallBoolG(smallBoolt *self, uint32_t p2)
internal bool equalSmallBoolSmallDouble(smallBoolt *self, smallDoublet *p2)
internal bool equalSmallBoolUint64(smallBoolt *self, uint64_t p2)
internal smallBoolt * duplicateSmallBool(smallBoolt *self)
#define toStringO(obj)
convert data in obj to string
bool equalSmallBoolSmallBytesG(smallBoolt *self, smallBytest *p2)
smallBoolt * setSmallBoolSmallBoolG(smallBoolt *self, smallBoolt *p2)
void finalizeSmallBool(void)
internal smallBoolt * readFileSmallStringSmallBool(smallBoolt *self, smallStringt *filePath)
void initiateAllocateSmallBool(smallBoolt **self)
toStringSmallBoolFt toString
smallBoolt * readFileSmallBoolG(smallBoolt *self, const char *filePath)
int writeFileSmallJsonSmallBoolG(smallBoolt *self, smallJsont *filePath)
bool equalSmallBoolDoubleG(smallBoolt *self, double p2)
internal int appendFileSmallStringSmallBool(smallBoolt *self, smallStringt *filePath)
bool equalSmallBoolSmallJsonG(smallBoolt *self, smallJsont *p2)
internal void finishSmallBool(smallBoolt **self)
#define equalSO(self, string)
smallBoolt * setSmallIntSmallBoolG(smallBoolt *self, smallIntt *p2)
#define BLD
bold for color function
internal bool equalSmallBoolInt32(smallBoolt *self, int32_t p2)
void cleanUpSmallBoolFinishG(smallBoolt **val)
internal void freeSmallBool(smallBoolt *self)
internal smallBoolt * setUint64SmallBool(smallBoolt *self, uint64_t p2)
internal smallBoolt * setSmallJsonSmallBool(smallBoolt *self, smallJsont *p2)
smallBoolt * setInt64SmallBoolG(smallBoolt *self, int64_t p2)
smallBoolt * setDoubleSmallBoolG(smallBoolt *self, double p2)
smallBoolt * setSSmallBoolG(smallBoolt *self, const char *p2)
internal smallBoolt * setDoubleSmallBool(smallBoolt *self, double p2)
internal bool equalSmallBoolBase(smallBoolt *self, baset *p2)
smallBoolt * setSmallJsonSmallBoolG(smallBoolt *self, smallJsont *p2)
int writeStreamSmallBoolG(smallBoolt *self, FILE *fp)
internal bool equalSmallBoolSmallBytes(smallBoolt *self, smallBytest *p2)
void finalizeRecycleSmallBool(void *arg UNUSED)
smallBoolt * setInt32SmallBoolG(smallBoolt *self, int32_t p2)
sBoolt * allocSBool(bool value)
allocate a small bool
bool equalSmallBoolUint64G(smallBoolt *self, uint64_t p2)
smallBoolt * duplicateSmallBoolG(smallBoolt *self)
smallBoolt * setSmallDoubleSmallBoolG(smallBoolt *self, smallDoublet *p2)
void freeSmallBoolG(smallBoolt *self)
internal int writeFileSmallJsonSmallBool(smallBoolt *self, smallJsont *filePath)
internal int writeStreamSmallBool(smallBoolt *self, FILE *fp)
void shEPrintfS(const char *fmt,...)
sheepy Error printf String print with logE
internal bool equalSmallBool(smallBoolt *self, smallBoolt *p2)
#define freeO(obj)
free buffers in obj
void cleanUpSmallBoolTerminateG(smallBoolt **val)
bool equalSmallBoolSmallStringG(smallBoolt *self, smallStringt *p2)
internal smallBoolt * setInt64SmallBool(smallBoolt *self, int64_t p2)
bool equalSmallBoolUint32G(smallBoolt *self, uint32_t p2)
internal smallBoolt * readFileSmallBool(smallBoolt *self, const char *filePath)
internal bool equalSmallBoolSmallJson(smallBoolt *self, smallJsont *p2)
#define finishO(obj)
free container only
duplicateSmallBoolFt duplicate
smallDoubleFunctionst * f
int appendFileSmallBoolFG(smallBoolt *self, const char *filePath)
bool equalSmallBoolBoolG(smallBoolt *self, bool p2)
internal smallBoolt * setSmallStringSmallBool(smallBoolt *self, smallStringt *p2)
smallBoolt * readStreamSmallBoolG(smallBoolt *self, FILE *fp)
#define isOSmallString(obj)
test if obj type is smallString