22
22
#include <config/libraries.h>
24
namespace filter::usfm {
24
26
class BookChapterData
27
BookChapterData (int book_in, int chapter_in, string data_in);
29
BookChapterData (int book, int chapter, string data);
33
string usfm_one_string (string usfm);
34
vector <string> usfm_get_markers_and_text (string code);
35
string usfm_get_marker (string usfm);
35
string one_string (string usfm);
36
vector <string> get_markers_and_text (string code);
37
string get_marker (string usfm);
36
38
vector <BookChapterData> usfm_import (string input, string stylesheet);
37
vector <int> usfm_get_verse_numbers (string usfm);
38
vector <int> usfm_get_chapter_numbers (string usfm);
39
vector <int> usfm_linenumber_to_versenumber (string usfm, unsigned int line_number);
40
vector <int> usfm_offset_to_versenumber (string usfm, unsigned int offset);
41
int usfm_versenumber_to_offset (string usfm, int verse);
42
string usfm_get_verse_text (string usfm, int verse);
43
string usfm_get_verse_text_quill (string usfm, int verse_number);
44
string usfm_get_chapter_text (string usfm, int chapter_number);
45
string usfm_get_verse_range_text (string usfm, int verse_from, int verse_to, const string& exclude_usfm, bool quill);
46
bool usfm_is_usfm_marker (string code);
47
bool usfm_is_opening_marker (string usfm);
48
bool usfm_is_embedded_marker (string usfm);
49
string usfm_get_book_identifier (const vector <string>& usfm, unsigned int pointer);
50
string usfm_get_text_following_marker (const vector <string>& usfm, unsigned int & pointer);
51
string usfm_peek_text_following_marker (const vector <string>& usfm, unsigned int pointer);
52
string usfm_peek_verse_number (string usfm);
53
string usfm_get_opening_usfm (string text, bool embedded = false);
54
string usfm_get_closing_usfm (string text, bool embedded = false);
55
string usfm_save_is_safe (void * webserver_request, string oldtext, string newtext, bool chapter, string & explanation);
56
string usfm_safely_store_chapter (void * webserver_request,
57
string bible, int book, int chapter, string usfm, string & explanation);
58
string usfm_safely_store_verse (void * webserver_request,
59
string bible, int book, int chapter, int verse, string usfm,
60
string & explanation, bool quill);
61
bool usfm_contains_empty_verses (string usfm);
62
bool usfm_handle_verse_range (string verse, vector <int> & verses);
63
bool usfm_handle_verse_sequence (string verse, vector <int> & verses);
64
const char * usfm_marker_v ();
65
const char * usfm_marker_va ();
66
const char * usfm_marker_vp ();
67
string usfm_remove_w_attributes (string usfm);
68
string usfm_extract_fig (string usfm, string & caption, string & alt, string& src, string& size, string& loc, string& copy, string& ref);
69
bool usfm_is_standard_q_poetry (const string & marker);
39
vector <int> get_verse_numbers (string usfm);
40
vector <int> get_chapter_numbers (string usfm);
41
vector <int> linenumber_to_versenumber (string usfm, unsigned int line_number);
42
vector <int> offset_to_versenumber (string usfm, unsigned int offset);
43
int versenumber_to_offset (string usfm, int verse);
44
string get_verse_text (string usfm, int verse);
45
string get_verse_text_quill (string usfm, int verse_number);
46
string get_chapter_text (string usfm, int chapter_number);
47
string get_verse_range_text (string usfm, int verse_from, int verse_to, const string& exclude_usfm, bool quill);
48
bool is_usfm_marker (string code);
49
bool is_opening_marker (string usfm);
50
bool is_embedded_marker (string usfm);
51
string get_book_identifier (const vector <string>& usfm, unsigned int pointer);
52
string get_text_following_marker (const vector <string>& usfm, unsigned int & pointer);
53
string peek_text_following_marker (const vector <string>& usfm, unsigned int pointer);
54
string peek_verse_number (string usfm);
55
string get_opening_usfm (string text, bool embedded = false);
56
string get_closing_usfm (string text, bool embedded = false);
57
string save_is_safe (void * webserver_request, string oldtext, string newtext, bool chapter, string & explanation);
58
string safely_store_chapter (void * webserver_request,
59
string bible, int book, int chapter, string usfm, string & explanation);
60
string safely_store_verse (void * webserver_request,
61
string bible, int book, int chapter, int verse, string usfm,
62
string & explanation, bool quill);
63
bool contains_empty_verses (string usfm);
64
bool handle_verse_range (string verse, vector <int> & verses);
65
bool handle_verse_sequence (string verse, vector <int> & verses);
66
const char * marker_v ();
67
const char * marker_va ();
68
const char * marker_vp ();
69
void remove_word_level_attributes (const string & marker,
70
vector <string> & container, unsigned int & pointer);
71
string extract_fig (string usfm, string & caption, string & alt, string& src, string& size, string& loc, string& copy, string& ref);
72
bool is_standard_q_poetry (const string & marker);