33 #define MAX_TERM_LENGTH 245 35 #if defined(_WIN32) && !defined(__CYGWIN__) 50 size_t strBegin = str.find_first_not_of(whitespace);
51 if (strBegin == std::string::npos)
54 size_t strEnd = str.find_last_not_of(whitespace);
55 int strRange = strEnd - strBegin + 1;
57 return str.substr(strBegin, strRange);
71 size_t beginSpace = result.find_first_of(whitespace);
72 while (beginSpace != std::string::npos)
74 size_t endSpace = result.find_first_not_of(whitespace, beginSpace);
75 int range = endSpace - beginSpace;
77 result.replace(beginSpace, range,
fill);
79 size_t newStart = beginSpace +
fill.length();
80 beginSpace = result.find_first_of(whitespace, newStart);
89 std::istringstream iss(s);
90 std::istream_iterator<std::string>
begin(iss),
end,it;
95 std::transform(lword.begin(), lword.end(), lword.begin(), ::tolower);
107 QRegExp re(
"[A-Z_a-z][A-Z_a-z0-9]*");
110 while ((i=re.
match(qs,p,&l))!=-1)
121 while ((pos = str.find(old, pos)) != std::string::npos)
123 str.replace(pos, old.length(), repl);
124 pos += repl.length();
148 :
m_db((path+
"doxysearch.db").utf8().
data(),Xapian::DB_CREATE_OR_OVERWRITE),
202 size_t pos = term.rfind(
"::");
203 if (pos!=std::string::npos)
205 partTerm = term.substr(pos+2);
212 if (!partTerm.empty())
220 if (!partTerm.empty())
226 m_doc.clear_values();
295 std::cerr <<
"Fatal error at line " << exception.
lineNumber()
308 std::cerr <<
"Usage: " << name <<
" [-o output_dir] searchdata.xml [searchdata2.xml ...]" <<
std::endl;
320 for (
int i=1;i<argc;i++)
326 std::cerr <<
"Error: missing parameter for -o option" <<
std::endl;
336 std::cerr <<
"Error: specified output directory does not exist!" <<
std::endl;
355 for (
int i=1;i<argc;i++)
364 std::cout <<
"Processing " << xmlFileName.
utf8() <<
"..." <<
std::endl;
365 QFile xmlFile(xmlFileName);
370 reader.
parse(source);
376 std::cerr <<
"Caught exception: " << e.get_description() <<
std::endl;
380 std::cerr <<
"Caught an unknown exception" <<
std::endl;
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
static std::string reduce(const std::string &str, const std::string &fill=" ", const std::string &whitespace=" \t")
bool characters(const QString &ch)
static void replace_all(std::string &str, const std::string &old, const std::string &repl)
static std::string trim(const std::string &str, const std::string &whitespace=" \t")
The QRegExp class provides pattern matching using regular expressions or wildcards.
static void addIdentifiers(const std::string &s, Xapian::Document &doc, int wfd)
XMLContentHandler(const QString &path)
bool parse(const QXmlInputSource &input)
int main(int argc, const char **argv)
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
void setErrorHandler(QXmlErrorHandler *handler)
The QXmlErrorHandler class provides an interface to report errors in XML data.
bool startElement(const QString &, const QString &, const QString &name, const QXmlAttributes &attrib)
QString value(int index) const
Xapian::TermGenerator m_indexer
The QXmlSimpleReader class provides an implementation of a simple XML reader (i.e. parser).
void setContentHandler(QXmlContentHandler *handler)
bool warning(const QXmlParseException &)
nvidia::inferenceserver::client::Error Error
Xapian::WritableDatabase m_db
The QXmlDefaultHandler class provides a default implementation of all XML handler classes...
const char * data() const
QCString mid(uint index, uint len=0xffffffff) const
int match(const QCString &str, int index=0, int *len=0, bool indexIsStart=TRUE) const
The QFile class is an I/O device that operates on files.
static void usage(const char *name)
static void safeAddTerm(const std::string &term, Xapian::Document &doc, int wfd)
bool error(const QXmlParseException &)
virtual ~XMLErrorHandler()
The QXmlAttributes class provides XML attributes.
static msg_handler handler
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
static void addWords(const std::string &s, Xapian::Document &doc, int wfd)
FieldNames m_curFieldName
bool fatalError(const QXmlParseException &exception)
The QFileInfo class provides system-independent file information.
bool endElement(const QString &, const QString &, const QString &name)
union ptb::content::word::word word
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
The QXmlParseException class is used to report errors with the QXmlErrorHandler interface.
static std::string unescapeXmlEntities(const std::string &s)