5
|
|
|
|
|
|
|
/*
* ***********************************************
*
* !!!! DO NOT EDIT !!!!
*
* This file was auto-generated by Build.PL.
*
* ***********************************************
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef H_CLOWNFISH_STRING
#define H_CLOWNFISH_STRING 1
#ifdef __cplusplus
extern "C" {
#endif
#include "cfish_parcel.h"
// For strlen
#include <string.h>
// For CFISH_ALLOCA_OBJ.
#include "Clownfish/Class.h"
// For CFISH_ERR_FUNC_MACRO.
#include "Clownfish/Err.h"
/* Include the header for this class's parent.
*/
#include "Clownfish/Obj.h"
/* Define the struct layout for instances of this class.
*/
#ifdef C_CFISH_STRING
extern uint32_t cfish_Str_IVARS_OFFSET;
typedef struct cfish_StringIVARS cfish_StringIVARS;
static CFISH_INLINE cfish_StringIVARS*
cfish_Str_IVARS(cfish_String *self) {
char *ptr = (char*)self + cfish_Str_IVARS_OFFSET;
return (cfish_StringIVARS*)ptr;
}
#ifdef CFISH_USE_SHORT_NAMES
#define StringIVARS cfish_StringIVARS
#define Str_IVARS cfish_Str_IVARS
#endif
struct cfish_String {
CFISH_OBJ_HEAD
cfish_Class* klass;
const char* ptr;
size_t size;
cfish_String* origin;
};
#endif /* C_CFISH_STRING */
/* Declare this class's inert variables.
*/
/* Declare both this class's inert functions and the C functions which
* implement this class's dynamic methods.
*/
CFISH_VISIBLE bool
cfish_Str_utf8_valid(const char* ptr, size_t len);
CFISH_VISIBLE void
cfish_Str_validate_utf8(const char* text, size_t size, const char* file, int line, const char* func);
CFISH_VISIBLE bool
cfish_Str_is_whitespace(int32_t code_point);
CFISH_VISIBLE uint32_t
cfish_Str_encode_utf8_char(int32_t code_point, void* buffer);
CFISH_VISIBLE cfish_String*
cfish_Str_new_from_utf8(const char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_new_from_trusted_utf8(const char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_init_from_trusted_utf8(cfish_String* self, const char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_new_steal_utf8(char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_new_steal_trusted_utf8(char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_init_steal_trusted_utf8(cfish_String* self, char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_new_wrap_utf8(const char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_new_wrap_trusted_utf8(const char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_init_stack_string(void* allocation, const char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_init_wrap_trusted_utf8(cfish_String* self, const char* utf8, size_t size);
CFISH_VISIBLE cfish_String*
cfish_Str_new_from_char(int32_t code_point);
CFISH_VISIBLE cfish_String*
cfish_Str_newf(const char* pattern, ...);
void*
CFISH_Str_To_Host_IMP(cfish_String* self, void* vcache);
cfish_String*
CFISH_Str_Cat_IMP(cfish_String* self, cfish_String* other);
cfish_String*
CFISH_Str_Cat_Utf8_IMP(cfish_String* self, const char* utf8, size_t size);
cfish_String*
CFISH_Str_Cat_Trusted_Utf8_IMP(cfish_String* self, const char* utf8, size_t size);
int64_t
CFISH_Str_To_I64_IMP(cfish_String* self);
int64_t
CFISH_Str_BaseX_To_I64_IMP(cfish_String* self, uint32_t base);
double
CFISH_Str_To_F64_IMP(cfish_String* self);
bool
CFISH_Str_Starts_With_IMP(cfish_String* self, cfish_String* prefix);
bool
CFISH_Str_Starts_With_Utf8_IMP(cfish_String* self, const char* utf8, size_t size);
bool
CFISH_Str_Ends_With_IMP(cfish_String* self, cfish_String* suffix);
bool
CFISH_Str_Ends_With_Utf8_IMP(cfish_String* self, const char* utf8, size_t size);
bool
CFISH_Str_Contains_IMP(cfish_String* self, cfish_String* substring);
bool
CFISH_Str_Contains_Utf8_IMP(cfish_String* self, const char* utf8, size_t size);
cfish_StringIterator*
CFISH_Str_Find_IMP(cfish_String* self, cfish_String* substring);
cfish_StringIterator*
CFISH_Str_Find_Utf8_IMP(cfish_String* self, const char* utf8, size_t size);
bool
CFISH_Str_Equals_IMP(cfish_String* self, cfish_Obj* other);
bool
CFISH_Str_Equals_Utf8_IMP(cfish_String* self, const char* utf8, size_t size);
size_t
CFISH_Str_Length_IMP(cfish_String* self);
size_t
CFISH_Str_Get_Size_IMP(cfish_String* self);
const char*
CFISH_Str_Get_Ptr8_IMP(cfish_String* self);
char*
CFISH_Str_To_Utf8_IMP(cfish_String* self);
cfish_ByteBuf*
CFISH_Str_To_ByteBuf_IMP(cfish_String* self);
cfish_String*
CFISH_Str_Clone_IMP(cfish_String* self);
bool
CFISH_Str_Is_Copy_On_IncRef_IMP(cfish_String* self);
int32_t
CFISH_Str_Compare_To_IMP(cfish_String* self, cfish_Obj* other);
size_t
CFISH_Str_Hash_Sum_IMP(cfish_String* self);
cfish_String*
CFISH_Str_To_String_IMP(cfish_String* self);
cfish_String*
CFISH_Str_Trim_IMP(cfish_String* self);
cfish_String*
CFISH_Str_Trim_Top_IMP(cfish_String* self);
cfish_String*
CFISH_Str_Trim_Tail_IMP(cfish_String* self);
int32_t
CFISH_Str_Code_Point_At_IMP(cfish_String* self, size_t tick);
int32_t
CFISH_Str_Code_Point_From_IMP(cfish_String* self, size_t tick);
cfish_String*
CFISH_Str_SubString_IMP(cfish_String* self, size_t offset, size_t length);
cfish_StringIterator*
CFISH_Str_Top_IMP(cfish_String* self);
cfish_StringIterator*
CFISH_Str_Tail_IMP(cfish_String* self);
void
CFISH_Str_Destroy_IMP(cfish_String* self);
/* Define typedefs for each dynamic method, allowing us to cast generic
* pointers to the appropriate function pointer type more cleanly.
*/
typedef void*
(*CFISH_Str_To_Host_t)(cfish_String* self, void* vcache);
typedef cfish_String*
(*CFISH_Str_Clone_t)(cfish_String* self);
typedef bool
(*CFISH_Str_Equals_t)(cfish_String* self, cfish_Obj* other);
typedef int32_t
(*CFISH_Str_Compare_To_t)(cfish_String* self, cfish_Obj* other);
typedef void
(*CFISH_Str_Destroy_t)(cfish_String* self);
typedef cfish_String*
(*CFISH_Str_To_String_t)(cfish_String* self);
typedef cfish_String*
(*CFISH_Str_Cat_t)(cfish_String* self, cfish_String* other);
typedef cfish_String*
(*CFISH_Str_Cat_Utf8_t)(cfish_String* self, const char* utf8, size_t size);
typedef cfish_String*
(*CFISH_Str_Cat_Trusted_Utf8_t)(cfish_String* self, const char* utf8, size_t size);
typedef int64_t
(*CFISH_Str_To_I64_t)(cfish_String* self);
typedef int64_t
(*CFISH_Str_BaseX_To_I64_t)(cfish_String* self, uint32_t base);
typedef double
(*CFISH_Str_To_F64_t)(cfish_String* self);
typedef bool
(*CFISH_Str_Starts_With_t)(cfish_String* self, cfish_String* prefix);
typedef bool
(*CFISH_Str_Starts_With_Utf8_t)(cfish_String* self, const char* utf8, size_t size);
typedef bool
(*CFISH_Str_Ends_With_t)(cfish_String* self, cfish_String* suffix);
typedef bool
(*CFISH_Str_Ends_With_Utf8_t)(cfish_String* self, const char* utf8, size_t size);
typedef bool
(*CFISH_Str_Contains_t)(cfish_String* self, cfish_String* substring);
typedef bool
(*CFISH_Str_Contains_Utf8_t)(cfish_String* self, const char* utf8, size_t size);
typedef cfish_StringIterator*
(*CFISH_Str_Find_t)(cfish_String* self, cfish_String* substring);
typedef cfish_StringIterator*
(*CFISH_Str_Find_Utf8_t)(cfish_String* self, const char* utf8, size_t size);
typedef bool
(*CFISH_Str_Equals_Utf8_t)(cfish_String* self, const char* utf8, size_t size);
typedef size_t
(*CFISH_Str_Length_t)(cfish_String* self);
typedef size_t
(*CFISH_Str_Get_Size_t)(cfish_String* self);
typedef const char*
(*CFISH_Str_Get_Ptr8_t)(cfish_String* self);
typedef char*
(*CFISH_Str_To_Utf8_t)(cfish_String* self);
typedef cfish_ByteBuf*
(*CFISH_Str_To_ByteBuf_t)(cfish_String* self);
typedef bool
(*CFISH_Str_Is_Copy_On_IncRef_t)(cfish_String* self);
typedef size_t
(*CFISH_Str_Hash_Sum_t)(cfish_String* self);
typedef cfish_String*
(*CFISH_Str_Trim_t)(cfish_String* self);
typedef cfish_String*
(*CFISH_Str_Trim_Top_t)(cfish_String* self);
typedef cfish_String*
(*CFISH_Str_Trim_Tail_t)(cfish_String* self);
typedef int32_t
(*CFISH_Str_Code_Point_At_t)(cfish_String* self, size_t tick);
typedef int32_t
(*CFISH_Str_Code_Point_From_t)(cfish_String* self, size_t tick);
typedef cfish_String*
(*CFISH_Str_SubString_t)(cfish_String* self, size_t offset, size_t length);
typedef cfish_StringIterator*
(*CFISH_Str_Top_t)(cfish_String* self);
typedef cfish_StringIterator*
(*CFISH_Str_Tail_t)(cfish_String* self);
/* Define type-safe wrappers for inert functions of Obj.
*/
static CFISH_INLINE cfish_Class*
cfish_Str_get_class(cfish_String *self) {
return cfish_Obj_get_class((cfish_Obj*)self);
}
static CFISH_INLINE cfish_String*
cfish_Str_get_class_name(cfish_String *self) {
return cfish_Obj_get_class_name((cfish_Obj*)self);
}
static CFISH_INLINE bool
cfish_Str_is_a(cfish_String *self, cfish_Class *ancestor) {
return cfish_Obj_is_a((cfish_Obj*)self, ancestor);
}
/* Define the inline functions which implement this class's virtual methods.
*/
extern CFISH_VISIBLE uint32_t CFISH_Str_To_Host_OFFSET;
static CFISH_INLINE void*
CFISH_Str_To_Host(cfish_String* self, void* vcache) {
#ifdef CFP_CFISH
return CFISH_Str_To_Host_IMP(self, vcache);
#else
const CFISH_Str_To_Host_t method = (CFISH_Str_To_Host_t)cfish_obj_method(self, CFISH_Str_To_Host_OFFSET);
return method(self, vcache);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Clone_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_Clone(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Clone_IMP(self);
#else
const CFISH_Str_Clone_t method = (CFISH_Str_Clone_t)cfish_obj_method(self, CFISH_Str_Clone_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Equals_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Equals(cfish_String* self, cfish_Obj* other) {
#ifdef CFP_CFISH
return CFISH_Str_Equals_IMP(self, other);
#else
const CFISH_Str_Equals_t method = (CFISH_Str_Equals_t)cfish_obj_method(self, CFISH_Str_Equals_OFFSET);
return method(self, other);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Compare_To_OFFSET;
static CFISH_INLINE int32_t
CFISH_Str_Compare_To(cfish_String* self, cfish_Obj* other) {
#ifdef CFP_CFISH
return CFISH_Str_Compare_To_IMP(self, other);
#else
const CFISH_Str_Compare_To_t method = (CFISH_Str_Compare_To_t)cfish_obj_method(self, CFISH_Str_Compare_To_OFFSET);
return method(self, other);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Destroy_OFFSET;
static CFISH_INLINE void
CFISH_Str_Destroy(cfish_String* self) {
#ifdef CFP_CFISH
CFISH_Str_Destroy_IMP(self);
#else
const CFISH_Str_Destroy_t method = (CFISH_Str_Destroy_t)cfish_obj_method(self, CFISH_Str_Destroy_OFFSET);
method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_To_String_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_To_String(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_To_String_IMP(self);
#else
const CFISH_Str_To_String_t method = (CFISH_Str_To_String_t)cfish_obj_method(self, CFISH_Str_To_String_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Cat_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_Cat(cfish_String* self, cfish_String* other) {
#ifdef CFP_CFISH
return CFISH_Str_Cat_IMP(self, other);
#else
const CFISH_Str_Cat_t method = (CFISH_Str_Cat_t)cfish_obj_method(self, CFISH_Str_Cat_OFFSET);
return method(self, other);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Cat_Utf8_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_Cat_Utf8(cfish_String* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_Str_Cat_Utf8_IMP(self, utf8, size);
#else
const CFISH_Str_Cat_Utf8_t method = (CFISH_Str_Cat_Utf8_t)cfish_obj_method(self, CFISH_Str_Cat_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Cat_Trusted_Utf8_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_Cat_Trusted_Utf8(cfish_String* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_Str_Cat_Trusted_Utf8_IMP(self, utf8, size);
#else
const CFISH_Str_Cat_Trusted_Utf8_t method = (CFISH_Str_Cat_Trusted_Utf8_t)cfish_obj_method(self, CFISH_Str_Cat_Trusted_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_To_I64_OFFSET;
static CFISH_INLINE int64_t
CFISH_Str_To_I64(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_To_I64_IMP(self);
#else
const CFISH_Str_To_I64_t method = (CFISH_Str_To_I64_t)cfish_obj_method(self, CFISH_Str_To_I64_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_BaseX_To_I64_OFFSET;
static CFISH_INLINE int64_t
CFISH_Str_BaseX_To_I64(cfish_String* self, uint32_t base) {
#ifdef CFP_CFISH
return CFISH_Str_BaseX_To_I64_IMP(self, base);
#else
const CFISH_Str_BaseX_To_I64_t method = (CFISH_Str_BaseX_To_I64_t)cfish_obj_method(self, CFISH_Str_BaseX_To_I64_OFFSET);
return method(self, base);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_To_F64_OFFSET;
static CFISH_INLINE double
CFISH_Str_To_F64(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_To_F64_IMP(self);
#else
const CFISH_Str_To_F64_t method = (CFISH_Str_To_F64_t)cfish_obj_method(self, CFISH_Str_To_F64_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Starts_With_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Starts_With(cfish_String* self, cfish_String* prefix) {
#ifdef CFP_CFISH
return CFISH_Str_Starts_With_IMP(self, prefix);
#else
const CFISH_Str_Starts_With_t method = (CFISH_Str_Starts_With_t)cfish_obj_method(self, CFISH_Str_Starts_With_OFFSET);
return method(self, prefix);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Starts_With_Utf8_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Starts_With_Utf8(cfish_String* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_Str_Starts_With_Utf8_IMP(self, utf8, size);
#else
const CFISH_Str_Starts_With_Utf8_t method = (CFISH_Str_Starts_With_Utf8_t)cfish_obj_method(self, CFISH_Str_Starts_With_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Ends_With_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Ends_With(cfish_String* self, cfish_String* suffix) {
#ifdef CFP_CFISH
return CFISH_Str_Ends_With_IMP(self, suffix);
#else
const CFISH_Str_Ends_With_t method = (CFISH_Str_Ends_With_t)cfish_obj_method(self, CFISH_Str_Ends_With_OFFSET);
return method(self, suffix);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Ends_With_Utf8_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Ends_With_Utf8(cfish_String* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_Str_Ends_With_Utf8_IMP(self, utf8, size);
#else
const CFISH_Str_Ends_With_Utf8_t method = (CFISH_Str_Ends_With_Utf8_t)cfish_obj_method(self, CFISH_Str_Ends_With_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Contains_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Contains(cfish_String* self, cfish_String* substring) {
#ifdef CFP_CFISH
return CFISH_Str_Contains_IMP(self, substring);
#else
const CFISH_Str_Contains_t method = (CFISH_Str_Contains_t)cfish_obj_method(self, CFISH_Str_Contains_OFFSET);
return method(self, substring);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Contains_Utf8_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Contains_Utf8(cfish_String* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_Str_Contains_Utf8_IMP(self, utf8, size);
#else
const CFISH_Str_Contains_Utf8_t method = (CFISH_Str_Contains_Utf8_t)cfish_obj_method(self, CFISH_Str_Contains_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Find_OFFSET;
static CFISH_INLINE cfish_StringIterator*
CFISH_Str_Find(cfish_String* self, cfish_String* substring) {
#ifdef CFP_CFISH
return CFISH_Str_Find_IMP(self, substring);
#else
const CFISH_Str_Find_t method = (CFISH_Str_Find_t)cfish_obj_method(self, CFISH_Str_Find_OFFSET);
return method(self, substring);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Find_Utf8_OFFSET;
static CFISH_INLINE cfish_StringIterator*
CFISH_Str_Find_Utf8(cfish_String* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_Str_Find_Utf8_IMP(self, utf8, size);
#else
const CFISH_Str_Find_Utf8_t method = (CFISH_Str_Find_Utf8_t)cfish_obj_method(self, CFISH_Str_Find_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Equals_Utf8_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Equals_Utf8(cfish_String* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_Str_Equals_Utf8_IMP(self, utf8, size);
#else
const CFISH_Str_Equals_Utf8_t method = (CFISH_Str_Equals_Utf8_t)cfish_obj_method(self, CFISH_Str_Equals_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Length_OFFSET;
static CFISH_INLINE size_t
CFISH_Str_Length(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Length_IMP(self);
#else
const CFISH_Str_Length_t method = (CFISH_Str_Length_t)cfish_obj_method(self, CFISH_Str_Length_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Get_Size_OFFSET;
static CFISH_INLINE size_t
CFISH_Str_Get_Size(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Get_Size_IMP(self);
#else
const CFISH_Str_Get_Size_t method = (CFISH_Str_Get_Size_t)cfish_obj_method(self, CFISH_Str_Get_Size_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Get_Ptr8_OFFSET;
static CFISH_INLINE const char*
CFISH_Str_Get_Ptr8(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Get_Ptr8_IMP(self);
#else
const CFISH_Str_Get_Ptr8_t method = (CFISH_Str_Get_Ptr8_t)cfish_obj_method(self, CFISH_Str_Get_Ptr8_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_To_Utf8_OFFSET;
static CFISH_INLINE char*
CFISH_Str_To_Utf8(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_To_Utf8_IMP(self);
#else
const CFISH_Str_To_Utf8_t method = (CFISH_Str_To_Utf8_t)cfish_obj_method(self, CFISH_Str_To_Utf8_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_To_ByteBuf_OFFSET;
static CFISH_INLINE cfish_ByteBuf*
CFISH_Str_To_ByteBuf(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_To_ByteBuf_IMP(self);
#else
const CFISH_Str_To_ByteBuf_t method = (CFISH_Str_To_ByteBuf_t)cfish_obj_method(self, CFISH_Str_To_ByteBuf_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Is_Copy_On_IncRef_OFFSET;
static CFISH_INLINE bool
CFISH_Str_Is_Copy_On_IncRef(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Is_Copy_On_IncRef_IMP(self);
#else
const CFISH_Str_Is_Copy_On_IncRef_t method = (CFISH_Str_Is_Copy_On_IncRef_t)cfish_obj_method(self, CFISH_Str_Is_Copy_On_IncRef_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Hash_Sum_OFFSET;
static CFISH_INLINE size_t
CFISH_Str_Hash_Sum(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Hash_Sum_IMP(self);
#else
const CFISH_Str_Hash_Sum_t method = (CFISH_Str_Hash_Sum_t)cfish_obj_method(self, CFISH_Str_Hash_Sum_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Trim_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_Trim(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Trim_IMP(self);
#else
const CFISH_Str_Trim_t method = (CFISH_Str_Trim_t)cfish_obj_method(self, CFISH_Str_Trim_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Trim_Top_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_Trim_Top(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Trim_Top_IMP(self);
#else
const CFISH_Str_Trim_Top_t method = (CFISH_Str_Trim_Top_t)cfish_obj_method(self, CFISH_Str_Trim_Top_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Trim_Tail_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_Trim_Tail(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Trim_Tail_IMP(self);
#else
const CFISH_Str_Trim_Tail_t method = (CFISH_Str_Trim_Tail_t)cfish_obj_method(self, CFISH_Str_Trim_Tail_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Code_Point_At_OFFSET;
static CFISH_INLINE int32_t
CFISH_Str_Code_Point_At(cfish_String* self, size_t tick) {
#ifdef CFP_CFISH
return CFISH_Str_Code_Point_At_IMP(self, tick);
#else
const CFISH_Str_Code_Point_At_t method = (CFISH_Str_Code_Point_At_t)cfish_obj_method(self, CFISH_Str_Code_Point_At_OFFSET);
return method(self, tick);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Code_Point_From_OFFSET;
static CFISH_INLINE int32_t
CFISH_Str_Code_Point_From(cfish_String* self, size_t tick) {
#ifdef CFP_CFISH
return CFISH_Str_Code_Point_From_IMP(self, tick);
#else
const CFISH_Str_Code_Point_From_t method = (CFISH_Str_Code_Point_From_t)cfish_obj_method(self, CFISH_Str_Code_Point_From_OFFSET);
return method(self, tick);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_SubString_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_Str_SubString(cfish_String* self, size_t offset, size_t length) {
#ifdef CFP_CFISH
return CFISH_Str_SubString_IMP(self, offset, length);
#else
const CFISH_Str_SubString_t method = (CFISH_Str_SubString_t)cfish_obj_method(self, CFISH_Str_SubString_OFFSET);
return method(self, offset, length);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Top_OFFSET;
static CFISH_INLINE cfish_StringIterator*
CFISH_Str_Top(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Top_IMP(self);
#else
const CFISH_Str_Top_t method = (CFISH_Str_Top_t)cfish_obj_method(self, CFISH_Str_Top_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_Str_Tail_OFFSET;
static CFISH_INLINE cfish_StringIterator*
CFISH_Str_Tail(cfish_String* self) {
#ifdef CFP_CFISH
return CFISH_Str_Tail_IMP(self);
#else
const CFISH_Str_Tail_t method = (CFISH_Str_Tail_t)cfish_obj_method(self, CFISH_Str_Tail_OFFSET);
return method(self);
#endif
}
/* Declare callbacks for wrapping host overrides.
*/
#ifdef CFISH_NO_DYNAMIC_OVERRIDES
#else
#endif
/* Define "short names" for this class's symbols.
*/
#ifdef CFISH_USE_SHORT_NAMES
#define String cfish_String
#define STRING CFISH_STRING
#define Str_utf8_valid cfish_Str_utf8_valid
#define Str_validate_utf8 cfish_Str_validate_utf8
#define Str_is_whitespace cfish_Str_is_whitespace
#define Str_encode_utf8_char cfish_Str_encode_utf8_char
#define Str_new_from_utf8 cfish_Str_new_from_utf8
#define Str_new_from_trusted_utf8 cfish_Str_new_from_trusted_utf8
#define Str_init_from_trusted_utf8 cfish_Str_init_from_trusted_utf8
#define Str_new_steal_utf8 cfish_Str_new_steal_utf8
#define Str_new_steal_trusted_utf8 cfish_Str_new_steal_trusted_utf8
#define Str_init_steal_trusted_utf8 cfish_Str_init_steal_trusted_utf8
#define Str_new_wrap_utf8 cfish_Str_new_wrap_utf8
#define Str_new_wrap_trusted_utf8 cfish_Str_new_wrap_trusted_utf8
#define Str_init_stack_string cfish_Str_init_stack_string
#define Str_init_wrap_trusted_utf8 cfish_Str_init_wrap_trusted_utf8
#define Str_new_from_char cfish_Str_new_from_char
#define Str_newf cfish_Str_newf
#define Str_get_class cfish_Str_get_class
#define Str_get_class_name cfish_Str_get_class_name
#define Str_is_a cfish_Str_is_a
#define Str_To_Host_IMP CFISH_Str_To_Host_IMP
#define Str_Cat_IMP CFISH_Str_Cat_IMP
#define Str_Cat_Utf8_IMP CFISH_Str_Cat_Utf8_IMP
#define Str_Cat_Trusted_Utf8_IMP CFISH_Str_Cat_Trusted_Utf8_IMP
#define Str_To_I64_IMP CFISH_Str_To_I64_IMP
#define Str_BaseX_To_I64_IMP CFISH_Str_BaseX_To_I64_IMP
#define Str_To_F64_IMP CFISH_Str_To_F64_IMP
#define Str_Starts_With_IMP CFISH_Str_Starts_With_IMP
#define Str_Starts_With_Utf8_IMP CFISH_Str_Starts_With_Utf8_IMP
#define Str_Ends_With_IMP CFISH_Str_Ends_With_IMP
#define Str_Ends_With_Utf8_IMP CFISH_Str_Ends_With_Utf8_IMP
#define Str_Contains_IMP CFISH_Str_Contains_IMP
#define Str_Contains_Utf8_IMP CFISH_Str_Contains_Utf8_IMP
#define Str_Find_IMP CFISH_Str_Find_IMP
#define Str_Find_Utf8_IMP CFISH_Str_Find_Utf8_IMP
#define Str_Equals_IMP CFISH_Str_Equals_IMP
#define Str_Equals_Utf8_IMP CFISH_Str_Equals_Utf8_IMP
#define Str_Length_IMP CFISH_Str_Length_IMP
#define Str_Get_Size_IMP CFISH_Str_Get_Size_IMP
#define Str_Get_Ptr8_IMP CFISH_Str_Get_Ptr8_IMP
#define Str_To_Utf8_IMP CFISH_Str_To_Utf8_IMP
#define Str_To_ByteBuf_IMP CFISH_Str_To_ByteBuf_IMP
#define Str_Clone_IMP CFISH_Str_Clone_IMP
#define Str_Is_Copy_On_IncRef_IMP CFISH_Str_Is_Copy_On_IncRef_IMP
#define Str_Compare_To_IMP CFISH_Str_Compare_To_IMP
#define Str_Hash_Sum_IMP CFISH_Str_Hash_Sum_IMP
#define Str_To_String_IMP CFISH_Str_To_String_IMP
#define Str_Trim_IMP CFISH_Str_Trim_IMP
#define Str_Trim_Top_IMP CFISH_Str_Trim_Top_IMP
#define Str_Trim_Tail_IMP CFISH_Str_Trim_Tail_IMP
#define Str_Code_Point_At_IMP CFISH_Str_Code_Point_At_IMP
#define Str_Code_Point_From_IMP CFISH_Str_Code_Point_From_IMP
#define Str_SubString_IMP CFISH_Str_SubString_IMP
#define Str_Top_IMP CFISH_Str_Top_IMP
#define Str_Tail_IMP CFISH_Str_Tail_IMP
#define Str_Destroy_IMP CFISH_Str_Destroy_IMP
#define Str_To_Host CFISH_Str_To_Host
#define Str_To_Host_t CFISH_Str_To_Host_t
#define Str_Clone CFISH_Str_Clone
#define Str_Clone_t CFISH_Str_Clone_t
#define Str_Equals CFISH_Str_Equals
#define Str_Equals_t CFISH_Str_Equals_t
#define Str_Compare_To CFISH_Str_Compare_To
#define Str_Compare_To_t CFISH_Str_Compare_To_t
#define Str_Destroy CFISH_Str_Destroy
#define Str_Destroy_t CFISH_Str_Destroy_t
#define Str_To_String CFISH_Str_To_String
#define Str_To_String_t CFISH_Str_To_String_t
#define Str_Cat CFISH_Str_Cat
#define Str_Cat_t CFISH_Str_Cat_t
#define Str_Cat_Utf8 CFISH_Str_Cat_Utf8
#define Str_Cat_Utf8_t CFISH_Str_Cat_Utf8_t
#define Str_Cat_Trusted_Utf8 CFISH_Str_Cat_Trusted_Utf8
#define Str_Cat_Trusted_Utf8_t CFISH_Str_Cat_Trusted_Utf8_t
#define Str_To_I64 CFISH_Str_To_I64
#define Str_To_I64_t CFISH_Str_To_I64_t
#define Str_BaseX_To_I64 CFISH_Str_BaseX_To_I64
#define Str_BaseX_To_I64_t CFISH_Str_BaseX_To_I64_t
#define Str_To_F64 CFISH_Str_To_F64
#define Str_To_F64_t CFISH_Str_To_F64_t
#define Str_Starts_With CFISH_Str_Starts_With
#define Str_Starts_With_t CFISH_Str_Starts_With_t
#define Str_Starts_With_Utf8 CFISH_Str_Starts_With_Utf8
#define Str_Starts_With_Utf8_t CFISH_Str_Starts_With_Utf8_t
#define Str_Ends_With CFISH_Str_Ends_With
#define Str_Ends_With_t CFISH_Str_Ends_With_t
#define Str_Ends_With_Utf8 CFISH_Str_Ends_With_Utf8
#define Str_Ends_With_Utf8_t CFISH_Str_Ends_With_Utf8_t
#define Str_Contains CFISH_Str_Contains
#define Str_Contains_t CFISH_Str_Contains_t
#define Str_Contains_Utf8 CFISH_Str_Contains_Utf8
#define Str_Contains_Utf8_t CFISH_Str_Contains_Utf8_t
#define Str_Find CFISH_Str_Find
#define Str_Find_t CFISH_Str_Find_t
#define Str_Find_Utf8 CFISH_Str_Find_Utf8
#define Str_Find_Utf8_t CFISH_Str_Find_Utf8_t
#define Str_Equals_Utf8 CFISH_Str_Equals_Utf8
#define Str_Equals_Utf8_t CFISH_Str_Equals_Utf8_t
#define Str_Length CFISH_Str_Length
#define Str_Length_t CFISH_Str_Length_t
#define Str_Get_Size CFISH_Str_Get_Size
#define Str_Get_Size_t CFISH_Str_Get_Size_t
#define Str_Get_Ptr8 CFISH_Str_Get_Ptr8
#define Str_Get_Ptr8_t CFISH_Str_Get_Ptr8_t
#define Str_To_Utf8 CFISH_Str_To_Utf8
#define Str_To_Utf8_t CFISH_Str_To_Utf8_t
#define Str_To_ByteBuf CFISH_Str_To_ByteBuf
#define Str_To_ByteBuf_t CFISH_Str_To_ByteBuf_t
#define Str_Is_Copy_On_IncRef CFISH_Str_Is_Copy_On_IncRef
#define Str_Is_Copy_On_IncRef_t CFISH_Str_Is_Copy_On_IncRef_t
#define Str_Hash_Sum CFISH_Str_Hash_Sum
#define Str_Hash_Sum_t CFISH_Str_Hash_Sum_t
#define Str_Trim CFISH_Str_Trim
#define Str_Trim_t CFISH_Str_Trim_t
#define Str_Trim_Top CFISH_Str_Trim_Top
#define Str_Trim_Top_t CFISH_Str_Trim_Top_t
#define Str_Trim_Tail CFISH_Str_Trim_Tail
#define Str_Trim_Tail_t CFISH_Str_Trim_Tail_t
#define Str_Code_Point_At CFISH_Str_Code_Point_At
#define Str_Code_Point_At_t CFISH_Str_Code_Point_At_t
#define Str_Code_Point_From CFISH_Str_Code_Point_From
#define Str_Code_Point_From_t CFISH_Str_Code_Point_From_t
#define Str_SubString CFISH_Str_SubString
#define Str_SubString_t CFISH_Str_SubString_t
#define Str_Top CFISH_Str_Top
#define Str_Top_t CFISH_Str_Top_t
#define Str_Tail CFISH_Str_Tail
#define Str_Tail_t CFISH_Str_Tail_t
#endif /* CFISH_USE_SHORT_NAMES */
/* Include the header for this class's parent.
*/
#include "Clownfish/Obj.h"
/* Define the struct layout for instances of this class.
*/
#ifdef C_CFISH_STRINGITERATOR
extern uint32_t cfish_StrIter_IVARS_OFFSET;
typedef struct cfish_StringIteratorIVARS cfish_StringIteratorIVARS;
static CFISH_INLINE cfish_StringIteratorIVARS*
cfish_StrIter_IVARS(cfish_StringIterator *self) {
char *ptr = (char*)self + cfish_StrIter_IVARS_OFFSET;
return (cfish_StringIteratorIVARS*)ptr;
}
#ifdef CFISH_USE_SHORT_NAMES
#define StringIteratorIVARS cfish_StringIteratorIVARS
#define StrIter_IVARS cfish_StrIter_IVARS
#endif
struct cfish_StringIterator {
CFISH_OBJ_HEAD
cfish_Class* klass;
cfish_String* string;
size_t byte_offset;
};
#endif /* C_CFISH_STRINGITERATOR */
/* Declare this class's inert variables.
*/
/* Declare both this class's inert functions and the C functions which
* implement this class's dynamic methods.
*/
CFISH_VISIBLE cfish_StringIterator*
cfish_StrIter_new(cfish_String* string, size_t byte_offset);
CFISH_VISIBLE cfish_String*
cfish_StrIter_crop(cfish_StringIterator* top, cfish_StringIterator* tail);
cfish_StringIterator*
CFISH_StrIter_Clone_IMP(cfish_StringIterator* self);
void
CFISH_StrIter_Assign_IMP(cfish_StringIterator* self, cfish_StringIterator* other);
bool
CFISH_StrIter_Equals_IMP(cfish_StringIterator* self, cfish_Obj* other);
int32_t
CFISH_StrIter_Compare_To_IMP(cfish_StringIterator* self, cfish_Obj* other);
bool
CFISH_StrIter_Has_Next_IMP(cfish_StringIterator* self);
bool
CFISH_StrIter_Has_Prev_IMP(cfish_StringIterator* self);
int32_t
CFISH_StrIter_Next_IMP(cfish_StringIterator* self);
int32_t
CFISH_StrIter_Prev_IMP(cfish_StringIterator* self);
size_t
CFISH_StrIter_Advance_IMP(cfish_StringIterator* self, size_t num);
size_t
CFISH_StrIter_Recede_IMP(cfish_StringIterator* self, size_t num);
size_t
CFISH_StrIter_Skip_Whitespace_IMP(cfish_StringIterator* self);
size_t
CFISH_StrIter_Skip_Whitespace_Back_IMP(cfish_StringIterator* self);
bool
CFISH_StrIter_Starts_With_IMP(cfish_StringIterator* self, cfish_String* prefix);
bool
CFISH_StrIter_Starts_With_Utf8_IMP(cfish_StringIterator* self, const char* utf8, size_t size);
bool
CFISH_StrIter_Ends_With_IMP(cfish_StringIterator* self, cfish_String* suffix);
bool
CFISH_StrIter_Ends_With_Utf8_IMP(cfish_StringIterator* self, const char* utf8, size_t size);
void
CFISH_StrIter_Destroy_IMP(cfish_StringIterator* self);
/* Define typedefs for each dynamic method, allowing us to cast generic
* pointers to the appropriate function pointer type more cleanly.
*/
typedef void*
(*CFISH_StrIter_To_Host_t)(cfish_StringIterator* self, void* vcache);
typedef cfish_StringIterator*
(*CFISH_StrIter_Clone_t)(cfish_StringIterator* self);
typedef bool
(*CFISH_StrIter_Equals_t)(cfish_StringIterator* self, cfish_Obj* other);
typedef int32_t
(*CFISH_StrIter_Compare_To_t)(cfish_StringIterator* self, cfish_Obj* other);
typedef void
(*CFISH_StrIter_Destroy_t)(cfish_StringIterator* self);
typedef cfish_String*
(*CFISH_StrIter_To_String_t)(cfish_StringIterator* self);
typedef void
(*CFISH_StrIter_Assign_t)(cfish_StringIterator* self, cfish_StringIterator* other);
typedef bool
(*CFISH_StrIter_Has_Next_t)(cfish_StringIterator* self);
typedef bool
(*CFISH_StrIter_Has_Prev_t)(cfish_StringIterator* self);
typedef int32_t
(*CFISH_StrIter_Next_t)(cfish_StringIterator* self);
typedef int32_t
(*CFISH_StrIter_Prev_t)(cfish_StringIterator* self);
typedef size_t
(*CFISH_StrIter_Advance_t)(cfish_StringIterator* self, size_t num);
typedef size_t
(*CFISH_StrIter_Recede_t)(cfish_StringIterator* self, size_t num);
typedef size_t
(*CFISH_StrIter_Skip_Whitespace_t)(cfish_StringIterator* self);
typedef size_t
(*CFISH_StrIter_Skip_Whitespace_Back_t)(cfish_StringIterator* self);
typedef bool
(*CFISH_StrIter_Starts_With_t)(cfish_StringIterator* self, cfish_String* prefix);
typedef bool
(*CFISH_StrIter_Starts_With_Utf8_t)(cfish_StringIterator* self, const char* utf8, size_t size);
typedef bool
(*CFISH_StrIter_Ends_With_t)(cfish_StringIterator* self, cfish_String* suffix);
typedef bool
(*CFISH_StrIter_Ends_With_Utf8_t)(cfish_StringIterator* self, const char* utf8, size_t size);
/* Define type-safe wrappers for inert functions of Obj.
*/
static CFISH_INLINE cfish_Class*
cfish_StrIter_get_class(cfish_StringIterator *self) {
return cfish_Obj_get_class((cfish_Obj*)self);
}
static CFISH_INLINE cfish_String*
cfish_StrIter_get_class_name(cfish_StringIterator *self) {
return cfish_Obj_get_class_name((cfish_Obj*)self);
}
static CFISH_INLINE bool
cfish_StrIter_is_a(cfish_StringIterator *self, cfish_Class *ancestor) {
return cfish_Obj_is_a((cfish_Obj*)self, ancestor);
}
/* Define the inline functions which implement this class's virtual methods.
*/
extern CFISH_VISIBLE uint32_t CFISH_StrIter_To_Host_OFFSET;
static CFISH_INLINE void*
CFISH_StrIter_To_Host(cfish_StringIterator* self, void* vcache) {
#ifdef CFP_CFISH
return CFISH_Obj_To_Host_IMP((cfish_Obj*)self, vcache);
#else
const CFISH_StrIter_To_Host_t method = (CFISH_StrIter_To_Host_t)cfish_obj_method(self, CFISH_StrIter_To_Host_OFFSET);
return method(self, vcache);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Clone_OFFSET;
static CFISH_INLINE cfish_StringIterator*
CFISH_StrIter_Clone(cfish_StringIterator* self) {
#ifdef CFP_CFISH
return CFISH_StrIter_Clone_IMP(self);
#else
const CFISH_StrIter_Clone_t method = (CFISH_StrIter_Clone_t)cfish_obj_method(self, CFISH_StrIter_Clone_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Equals_OFFSET;
static CFISH_INLINE bool
CFISH_StrIter_Equals(cfish_StringIterator* self, cfish_Obj* other) {
#ifdef CFP_CFISH
return CFISH_StrIter_Equals_IMP(self, other);
#else
const CFISH_StrIter_Equals_t method = (CFISH_StrIter_Equals_t)cfish_obj_method(self, CFISH_StrIter_Equals_OFFSET);
return method(self, other);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Compare_To_OFFSET;
static CFISH_INLINE int32_t
CFISH_StrIter_Compare_To(cfish_StringIterator* self, cfish_Obj* other) {
#ifdef CFP_CFISH
return CFISH_StrIter_Compare_To_IMP(self, other);
#else
const CFISH_StrIter_Compare_To_t method = (CFISH_StrIter_Compare_To_t)cfish_obj_method(self, CFISH_StrIter_Compare_To_OFFSET);
return method(self, other);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Destroy_OFFSET;
static CFISH_INLINE void
CFISH_StrIter_Destroy(cfish_StringIterator* self) {
#ifdef CFP_CFISH
CFISH_StrIter_Destroy_IMP(self);
#else
const CFISH_StrIter_Destroy_t method = (CFISH_StrIter_Destroy_t)cfish_obj_method(self, CFISH_StrIter_Destroy_OFFSET);
method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_To_String_OFFSET;
static CFISH_INLINE cfish_String*
CFISH_StrIter_To_String(cfish_StringIterator* self) {
#ifdef CFP_CFISH
return CFISH_Obj_To_String_IMP((cfish_Obj*)self);
#else
const CFISH_StrIter_To_String_t method = (CFISH_StrIter_To_String_t)cfish_obj_method(self, CFISH_StrIter_To_String_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Assign_OFFSET;
static CFISH_INLINE void
CFISH_StrIter_Assign(cfish_StringIterator* self, cfish_StringIterator* other) {
#ifdef CFP_CFISH
CFISH_StrIter_Assign_IMP(self, other);
#else
const CFISH_StrIter_Assign_t method = (CFISH_StrIter_Assign_t)cfish_obj_method(self, CFISH_StrIter_Assign_OFFSET);
method(self, other);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Has_Next_OFFSET;
static CFISH_INLINE bool
CFISH_StrIter_Has_Next(cfish_StringIterator* self) {
#ifdef CFP_CFISH
return CFISH_StrIter_Has_Next_IMP(self);
#else
const CFISH_StrIter_Has_Next_t method = (CFISH_StrIter_Has_Next_t)cfish_obj_method(self, CFISH_StrIter_Has_Next_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Has_Prev_OFFSET;
static CFISH_INLINE bool
CFISH_StrIter_Has_Prev(cfish_StringIterator* self) {
#ifdef CFP_CFISH
return CFISH_StrIter_Has_Prev_IMP(self);
#else
const CFISH_StrIter_Has_Prev_t method = (CFISH_StrIter_Has_Prev_t)cfish_obj_method(self, CFISH_StrIter_Has_Prev_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Next_OFFSET;
static CFISH_INLINE int32_t
CFISH_StrIter_Next(cfish_StringIterator* self) {
#ifdef CFP_CFISH
return CFISH_StrIter_Next_IMP(self);
#else
const CFISH_StrIter_Next_t method = (CFISH_StrIter_Next_t)cfish_obj_method(self, CFISH_StrIter_Next_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Prev_OFFSET;
static CFISH_INLINE int32_t
CFISH_StrIter_Prev(cfish_StringIterator* self) {
#ifdef CFP_CFISH
return CFISH_StrIter_Prev_IMP(self);
#else
const CFISH_StrIter_Prev_t method = (CFISH_StrIter_Prev_t)cfish_obj_method(self, CFISH_StrIter_Prev_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Advance_OFFSET;
static CFISH_INLINE size_t
CFISH_StrIter_Advance(cfish_StringIterator* self, size_t num) {
#ifdef CFP_CFISH
return CFISH_StrIter_Advance_IMP(self, num);
#else
const CFISH_StrIter_Advance_t method = (CFISH_StrIter_Advance_t)cfish_obj_method(self, CFISH_StrIter_Advance_OFFSET);
return method(self, num);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Recede_OFFSET;
static CFISH_INLINE size_t
CFISH_StrIter_Recede(cfish_StringIterator* self, size_t num) {
#ifdef CFP_CFISH
return CFISH_StrIter_Recede_IMP(self, num);
#else
const CFISH_StrIter_Recede_t method = (CFISH_StrIter_Recede_t)cfish_obj_method(self, CFISH_StrIter_Recede_OFFSET);
return method(self, num);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Skip_Whitespace_OFFSET;
static CFISH_INLINE size_t
CFISH_StrIter_Skip_Whitespace(cfish_StringIterator* self) {
#ifdef CFP_CFISH
return CFISH_StrIter_Skip_Whitespace_IMP(self);
#else
const CFISH_StrIter_Skip_Whitespace_t method = (CFISH_StrIter_Skip_Whitespace_t)cfish_obj_method(self, CFISH_StrIter_Skip_Whitespace_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Skip_Whitespace_Back_OFFSET;
static CFISH_INLINE size_t
CFISH_StrIter_Skip_Whitespace_Back(cfish_StringIterator* self) {
#ifdef CFP_CFISH
return CFISH_StrIter_Skip_Whitespace_Back_IMP(self);
#else
const CFISH_StrIter_Skip_Whitespace_Back_t method = (CFISH_StrIter_Skip_Whitespace_Back_t)cfish_obj_method(self, CFISH_StrIter_Skip_Whitespace_Back_OFFSET);
return method(self);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Starts_With_OFFSET;
static CFISH_INLINE bool
CFISH_StrIter_Starts_With(cfish_StringIterator* self, cfish_String* prefix) {
#ifdef CFP_CFISH
return CFISH_StrIter_Starts_With_IMP(self, prefix);
#else
const CFISH_StrIter_Starts_With_t method = (CFISH_StrIter_Starts_With_t)cfish_obj_method(self, CFISH_StrIter_Starts_With_OFFSET);
return method(self, prefix);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Starts_With_Utf8_OFFSET;
static CFISH_INLINE bool
CFISH_StrIter_Starts_With_Utf8(cfish_StringIterator* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_StrIter_Starts_With_Utf8_IMP(self, utf8, size);
#else
const CFISH_StrIter_Starts_With_Utf8_t method = (CFISH_StrIter_Starts_With_Utf8_t)cfish_obj_method(self, CFISH_StrIter_Starts_With_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Ends_With_OFFSET;
static CFISH_INLINE bool
CFISH_StrIter_Ends_With(cfish_StringIterator* self, cfish_String* suffix) {
#ifdef CFP_CFISH
return CFISH_StrIter_Ends_With_IMP(self, suffix);
#else
const CFISH_StrIter_Ends_With_t method = (CFISH_StrIter_Ends_With_t)cfish_obj_method(self, CFISH_StrIter_Ends_With_OFFSET);
return method(self, suffix);
#endif
}
extern CFISH_VISIBLE uint32_t CFISH_StrIter_Ends_With_Utf8_OFFSET;
static CFISH_INLINE bool
CFISH_StrIter_Ends_With_Utf8(cfish_StringIterator* self, const char* utf8, size_t size) {
#ifdef CFP_CFISH
return CFISH_StrIter_Ends_With_Utf8_IMP(self, utf8, size);
#else
const CFISH_StrIter_Ends_With_Utf8_t method = (CFISH_StrIter_Ends_With_Utf8_t)cfish_obj_method(self, CFISH_StrIter_Ends_With_Utf8_OFFSET);
return method(self, utf8, size);
#endif
}
/* Declare callbacks for wrapping host overrides.
*/
#ifdef CFISH_NO_DYNAMIC_OVERRIDES
#else
#endif
/* Define "short names" for this class's symbols.
*/
#ifdef CFISH_USE_SHORT_NAMES
#define StringIterator cfish_StringIterator
#define STRINGITERATOR CFISH_STRINGITERATOR
#define StrIter_new cfish_StrIter_new
#define StrIter_crop cfish_StrIter_crop
#define StrIter_get_class cfish_StrIter_get_class
#define StrIter_get_class_name cfish_StrIter_get_class_name
#define StrIter_is_a cfish_StrIter_is_a
#define StrIter_Clone_IMP CFISH_StrIter_Clone_IMP
#define StrIter_Assign_IMP CFISH_StrIter_Assign_IMP
#define StrIter_Equals_IMP CFISH_StrIter_Equals_IMP
#define StrIter_Compare_To_IMP CFISH_StrIter_Compare_To_IMP
#define StrIter_Has_Next_IMP CFISH_StrIter_Has_Next_IMP
#define StrIter_Has_Prev_IMP CFISH_StrIter_Has_Prev_IMP
#define StrIter_Next_IMP CFISH_StrIter_Next_IMP
#define StrIter_Prev_IMP CFISH_StrIter_Prev_IMP
#define StrIter_Advance_IMP CFISH_StrIter_Advance_IMP
#define StrIter_Recede_IMP CFISH_StrIter_Recede_IMP
#define StrIter_Skip_Whitespace_IMP CFISH_StrIter_Skip_Whitespace_IMP
#define StrIter_Skip_Whitespace_Back_IMP CFISH_StrIter_Skip_Whitespace_Back_IMP
#define StrIter_Starts_With_IMP CFISH_StrIter_Starts_With_IMP
#define StrIter_Starts_With_Utf8_IMP CFISH_StrIter_Starts_With_Utf8_IMP
#define StrIter_Ends_With_IMP CFISH_StrIter_Ends_With_IMP
#define StrIter_Ends_With_Utf8_IMP CFISH_StrIter_Ends_With_Utf8_IMP
#define StrIter_Destroy_IMP CFISH_StrIter_Destroy_IMP
#define StrIter_To_Host CFISH_StrIter_To_Host
#define StrIter_To_Host_t CFISH_StrIter_To_Host_t
#define StrIter_Clone CFISH_StrIter_Clone
#define StrIter_Clone_t CFISH_StrIter_Clone_t
#define StrIter_Equals CFISH_StrIter_Equals
#define StrIter_Equals_t CFISH_StrIter_Equals_t
#define StrIter_Compare_To CFISH_StrIter_Compare_To
#define StrIter_Compare_To_t CFISH_StrIter_Compare_To_t
#define StrIter_Destroy CFISH_StrIter_Destroy
#define StrIter_Destroy_t CFISH_StrIter_Destroy_t
#define StrIter_To_String CFISH_StrIter_To_String
#define StrIter_To_String_t CFISH_StrIter_To_String_t
#define StrIter_Assign CFISH_StrIter_Assign
#define StrIter_Assign_t CFISH_StrIter_Assign_t
#define StrIter_Has_Next CFISH_StrIter_Has_Next
#define StrIter_Has_Next_t CFISH_StrIter_Has_Next_t
#define StrIter_Has_Prev CFISH_StrIter_Has_Prev
#define StrIter_Has_Prev_t CFISH_StrIter_Has_Prev_t
#define StrIter_Next CFISH_StrIter_Next
#define StrIter_Next_t CFISH_StrIter_Next_t
#define StrIter_Prev CFISH_StrIter_Prev
#define StrIter_Prev_t CFISH_StrIter_Prev_t
#define StrIter_Advance CFISH_StrIter_Advance
#define StrIter_Advance_t CFISH_StrIter_Advance_t
#define StrIter_Recede CFISH_StrIter_Recede
#define StrIter_Recede_t CFISH_StrIter_Recede_t
#define StrIter_Skip_Whitespace CFISH_StrIter_Skip_Whitespace
#define StrIter_Skip_Whitespace_t CFISH_StrIter_Skip_Whitespace_t
#define StrIter_Skip_Whitespace_Back CFISH_StrIter_Skip_Whitespace_Back
#define StrIter_Skip_Whitespace_Back_t CFISH_StrIter_Skip_Whitespace_Back_t
#define StrIter_Starts_With CFISH_StrIter_Starts_With
#define StrIter_Starts_With_t CFISH_StrIter_Starts_With_t
#define StrIter_Starts_With_Utf8 CFISH_StrIter_Starts_With_Utf8
#define StrIter_Starts_With_Utf8_t CFISH_StrIter_Starts_With_Utf8_t
#define StrIter_Ends_With CFISH_StrIter_Ends_With
#define StrIter_Ends_With_t CFISH_StrIter_Ends_With_t
#define StrIter_Ends_With_Utf8 CFISH_StrIter_Ends_With_Utf8
#define StrIter_Ends_With_Utf8_t CFISH_StrIter_Ends_With_Utf8_t
#endif /* CFISH_USE_SHORT_NAMES */
#define CFISH_VALIDATE_UTF8(text, size) \
cfish_Str_validate_utf8(text, size, \
__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
#define CFISH_SSTR_BLANK() \
cfish_Str_init_stack_string(CFISH_ALLOCA_OBJ(CFISH_STRING), "", 0)
#define CFISH_SSTR_WRAP_C(ptr) \
cfish_Str_init_stack_string(CFISH_ALLOCA_OBJ(CFISH_STRING), ptr, \
strlen(ptr))
#define CFISH_SSTR_WRAP_UTF8(ptr, size) \
cfish_Str_init_stack_string(CFISH_ALLOCA_OBJ(CFISH_STRING), ptr, size)
#define CFISH_STR_OOB -1
#ifdef CFISH_USE_SHORT_NAMES
#define VALIDATE_UTF8 CFISH_VALIDATE_UTF8
#define SSTR_BLANK CFISH_SSTR_BLANK
#define SSTR_WRAP_C CFISH_SSTR_WRAP_C
#define SSTR_WRAP_UTF8 CFISH_SSTR_WRAP_UTF8
#define STR_OOB CFISH_STR_OOB
#endif
#ifdef __cplusplus
}
#endif
#endif /* H_CLOWNFISH_STRING */
|