+/**
+ * \brief Build a new Val Entry from all the low level arguments.
+ * Check for existence of dictionary entry, and build
+ * a default one when absent.
+ * @param group group number of the underlying DictEntry
+ * @param elem element number of the underlying DictEntry
+ */
+ValEntry *DocEntrySet::NewValEntryByNumber(uint16_t group,
+ uint16_t elem)
+{
+ // Find out if the tag we encountered is in the dictionaries:
+ DictEntry *dictEntry = GetDictEntryByNumber(group, elem);
+ if (!dictEntry)
+ {
+ dictEntry = NewVirtualDictEntry(group, elem);
+ }
+
+ ValEntry *newEntry = new ValEntry(dictEntry);
+ if (!newEntry)
+ {
+ dbg.Verbose(1, "Document::NewValEntryByNumber",
+ "failed to allocate ValEntry");
+ return 0;
+ }
+ return newEntry;
+}