[libc-commits] [libc] [libc][NFC] Add FieldTokenizer and FlatFileDatabase (PR #214720)
Alexey Samsonov via libc-commits
libc-commits at lists.llvm.org
Fri Aug 7 11:53:06 PDT 2026
================
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// In-place field tokenizer for colon-separated flat database files.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_SRC_PWD_FIELD_TOKENIZER_H
+#define LLVM_LIBC_SRC_PWD_FIELD_TOKENIZER_H
+
+#include "src/__support/CPP/optional.h"
+#include "src/__support/CPP/span.h"
+#include "src/__support/CPP/string_view.h"
+#include "src/__support/macros/attributes.h"
+#include "src/__support/macros/config.h"
+
+namespace LIBC_NAMESPACE_DECL {
+namespace pwd {
+
+// In-place field tokenizer for delimited database records.
+template <char Separator> class FieldTokenizer {
+ char *data_ptr;
----------------
vonosmas wrote:
I think it might be cleaner to just store `cpp::span<char> data` here... See below.
https://github.com/llvm/llvm-project/pull/214720
More information about the libc-commits
mailing list