MeshLib C Docs
Loading...
Searching...
No Matches
MRIOParsing.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRCMisc/common.h>
4#include <MRCMisc/exports.h>
5
6#include <stdbool.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12typedef struct MR_VertId MR_VertId; // Defined in `#include <MRCMesh/MRId.h>`.
13typedef struct MR_expected_void_std_string MR_expected_void_std_string; // Defined in `#include <MRCMisc/expected_void_std_string.h>`.
14typedef struct MR_std_vector_uint64_t MR_std_vector_uint64_t; // Defined in `#include <MRCMisc/std_vector_uint64_t.h>`.
15
16
17// returns offsets for each new line in monolith char block
20MRC_API MR_std_vector_uint64_t *MR_splitByLines(const char *data, MR_uint64_t size);
21
22// reads the first integer number in the line
28MRC_API MR_expected_void_std_string *MR_parseFirstNum(const char *str, const char *str_end, int *num);
29
30// reads the polygon points and optional number of polygon points
31// example
32// N vertex0 vertex1 ... vertexN
37MRC_API MR_expected_void_std_string *MR_parsePolygon(const char *str, const char *str_end, MR_VertId *vertId, int *numPoints);
38
39// checks if the given string starts with the UTF-8 byte-order mark
43MRC_API bool MR_hasBom(const char *str, const char *str_end);
44
45#ifdef __cplusplus
46} // extern "C"
47#endif
struct MR_std_vector_uint64_t MR_std_vector_uint64_t
Definition MRBitSet.h:56
struct MR_expected_void_std_string MR_expected_void_std_string
Definition MRCtm.h:26
MRC_API bool MR_hasBom(const char *str, const char *str_end)
MRC_API MR_expected_void_std_string * MR_parseFirstNum(const char *str, const char *str_end, int *num)
MRC_API MR_std_vector_uint64_t * MR_splitByLines(const char *data, MR_uint64_t size)
MRC_API MR_expected_void_std_string * MR_parsePolygon(const char *str, const char *str_end, MR_VertId *vertId, int *numPoints)
Definition MRId.h:55