Strs
Strs
Description
Vector of strings
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.c:118:
}
Strs StrSplit(Str *s, const char *key) {
ValidateStr(s);- In
Str.c:121:
ValidateStr(s);
Strs sv = VecInitWithDeepCopy(NULL, StrDeinit);
size keylen = ZstrLen(key);- In
Str.c:862:
}
void ValidateStrs(const Strs *vs) {
ValidateVec(vs);
VecForeachPtr(vs, sp) {- In
MisraDoc.c:23:
typedef struct Project {
Str build_dir;
Strs source_directories;
Strs test_directories;
} Project;- In
MisraDoc.c:24:
Str build_dir;
Strs source_directories;
Strs test_directories;
} Project;- In
MisraDoc.c:120:
// recursively explore directories and get files that need documentation
Strs file_paths = VecInit();
Scope(&file_paths, VecDeinit, {
// temporary vector to store all directory paths to explore files in
- In
MisraDoc.c:123:
Scope(&file_paths, VecDeinit, {
// temporary vector to store all directory paths to explore files in
Strs dir_paths = VecInitWithDeepCopy(NULL, StrDeinit);
Scope(&dir_paths, VecDeinit, {
VecMerge(&dir_paths, &project.source_directories);- In
Main.c:6:
Str file = StrInit();
if (ReadCompleteFile("Bin/Demangler/CppNameManglingGrammar", &file.data, &file.length, &file.capacity)) {
Strs lines = StrSplit(&file, "\n");
// Use the fixed VecForeachPtr macro
- In
Str.Type.c:42:
// Test Strs type definition
bool test_strs_type(void) {
WriteFmt("Testing Strs type definition\n");
// Create a Strs object (vector of strings)
- In
Str.Type.c:45:
// Create a Strs object (vector of strings)
Strs sv = VecInitWithDeepCopy(NULL, StrDeinit);
// Add some strings
- In
Str.Type.c:95:
// Create a valid Strs
Strs sv = VecInit();
// This should not crash
- In
Str.Type.c:130:
// Deadend test: Test ValidateStrs with invalid Strs (should crash/abort)
bool test_validate_invalid_strs(void) {
WriteFmt("Testing ValidateStrs with invalid Strs (should abort)\n");
// Create an invalid Strs by corrupting its fields
- In
Str.Type.c:133:
// Create an invalid Strs by corrupting its fields
Strs sv = VecInit();
// Corrupt the vector to make it invalid
- In
Str.Ops.c:167:
// Test StrSplit
Str s = StrInitFromZstr("Hello,World,Test");
Strs split = StrSplit(&s, ",");
bool result = (split.length == 3);- In
Ops.h:253:
/// FAILURE : Strs vector of zero-length
///
Strs StrSplit(Str *s, const char *key);
//
- In
Type.h:47:
/// FAILURE: `abort`
///
void ValidateStrs(const Strs *vs);
Last updated on