Chris@1855: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@1855: Chris@1855: /* Chris@1855: Sonic Visualiser Chris@1855: An audio file viewer and annotation editor. Chris@1855: Centre for Digital Music, Queen Mary, University of London. Chris@1855: Chris@1855: This program is free software; you can redistribute it and/or Chris@1855: modify it under the terms of the GNU General Public License as Chris@1855: published by the Free Software Foundation; either version 2 of the Chris@1855: License, or (at your option) any later version. See the file Chris@1855: COPYING included with this distribution for more information. Chris@1855: */ Chris@1855: Chris@1855: #ifndef SV_TEXT_TEST_H Chris@1855: #define SV_TEXT_TEST_H Chris@1855: Chris@1855: #include "data/fileio/FileSource.h" Chris@1855: Chris@1855: class TextTest Chris@1855: { Chris@1855: public: Chris@1855: /** Chris@1855: * Return true if the source appears to point to a text format of Chris@1855: * some kind (could be CSV, XML, RDF/Turtle etc). Chris@1855: * Chris@1855: * We apply two tests and report success if either succeeds: Chris@1855: * Chris@1855: * 1. The first few hundred bytes (where present) of the document Chris@1855: * are valid UTF-8 Chris@1855: * Chris@1855: * 2. The document starts with the text "