C++ 示例: ContinuousIntegerParser
ContinuousIntegerParser
示例是 BasicIntegerParser
的变体。这两个示例都从输入字符串中解析整数。 ContinuousIntegerParser
使用 连续加载 读取数据。
加载和使用示例
按如下所示加载 ContinuousIntegerParser
示例。
=> CREATE LIBRARY ContinuousIntegerParserLib AS '/home/dbadmin/CIP.so';
=> CREATE PARSER ContinuousIntegerParser AS
LANGUAGE 'C++' NAME 'ContinuousIntegerParserFactory'
LIBRARY ContinuousIntegerParserLib;
以使用 BasicIntegerParser
的同样方式使用它。请参阅C++ 示例: BasicIntegerParser。
实施
ContinuousIntegerParser
是 ContinuousUDParser
的子类。ContinuousUDParser
的子类将处理逻辑放在 run()
方法中。
有关 ContinuousUDParser
的更复杂示例,请参阅示例中的 ExampleDelimitedParser
。(请参阅下载并运行 UDx 示例代码。) ExampleDelimitedParser
使用块分割器;请参阅 C++ 示例:分隔解析器和块分割器。