Convenience function to get char* from a String returning an empty string on null pointer.
| 651 | // Convenience function to get char* from a String returning an empty string on |
| 652 | // null pointer. |
| 653 | static inline const char *GetCstring(const String *str) { |
| 654 | return str ? str->c_str() : ""; |
| 655 | } |
| 656 | |
| 657 | #ifdef FLATBUFFERS_HAS_STRING_VIEW |
| 658 | // Convenience function to get string_view from a String returning an empty |