Skip to content
Snippets Groups Projects
Commit 585b596a authored by Jonathan Schöbel's avatar Jonathan Schöbel
Browse files

TextFragment: added direct getter for text

While this method is neccessary to manipulate the content of a
TextFragment, the TextFragment should abstract the semantics of Text.
While simple wrapper functions for appending are to be added, methods
purely manipulating the text, i.e. relying on the text's contents, wont
get wrapper functions. Thus this method is still needed until a more
sophisticated approach is implemented.
parent 7152d569
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=37
current_page=17
FILE_NAME_0=139;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2FREADME;0;8
FILE_NAME_1=134;None;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2F.gitignore;0;8
FILE_NAME_2=1751;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fconfigure.ac;0;8
......@@ -45,8 +45,8 @@ FILE_NAME_12=2022;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fp
FILE_NAME_13=2558;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment_class.c;0;8
FILE_NAME_14=12838;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fnode_fragment.c;0;8
FILE_NAME_15=6478;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fnode_fragment.h;0;8
FILE_NAME_16=3795;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_fragment.c;0;8
FILE_NAME_17=1339;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_fragment.h;0;8
FILE_NAME_16=3278;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_fragment.c;0;8
FILE_NAME_17=1881;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ftext_fragment.h;0;8
FILE_NAME_18=4590;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fattr.c;0;8
FILE_NAME_19=2828;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fattr.h;0;8
FILE_NAME_20=3893;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fattr_static.c;0;8
......@@ -66,7 +66,7 @@ FILE_NAME_33=218;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fp
FILE_NAME_34=1085;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_cms.c;0;8
FILE_NAME_35=3283;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_data.c;0;8
FILE_NAME_36=132483;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_node_fragment.c;0;8
FILE_NAME_37=5299;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text_fragment.c;0;8
FILE_NAME_37=4771;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text_fragment.c;0;8
FILE_NAME_38=11319;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_attr.c;0;8
FILE_NAME_39=16715;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text.c;0;8
FILE_NAME_40=5744;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_validator.c;0;8
......
......@@ -140,6 +140,14 @@ SH_TextFragment_copy (const struct SH_TextFragment * fragment,
return (struct SH_Fragment *) copy;
}
/*@observer@*/
const struct SH_Text *
SH_TextFragment_get_text (const struct SH_TextFragment * fragment)
/*@*/
{
return fragment->text;
}
/*@null@*/
/*@only@*/
struct SH_Text *
......
......@@ -62,6 +62,11 @@ SH_TextFragment_copy (const SH_TextFragment * fragment,
/*@modifies fileSystem@*/
/*@modifies status@*/;
/*@observer@*/
const SH_Text *
SH_TextFragment_get_text (const SH_TextFragment * fragment)
/*@*/;
/*@null@*/
/*@only@*/
SH_Text *
......
......@@ -142,6 +142,29 @@ START_TEST(test_text_fragment_copy_with_status)
}
END_TEST
START_TEST(test_text_fragment_get_text)
{
SH_Data * data;
struct SH_TextFragment * fragment;
const SH_Text * text;
/* setup */
data = SH_Data_new (NULL);
ck_assert_ptr_ne (NULL, data);
fragment = (SH_TextFragment *)SH_TextFragment_new (data, NULL);
ck_assert_ptr_ne (NULL, fragment);
/* test */
text = SH_TextFragment_get_text (fragment);
ck_assert_ptr_eq (text, fragment->text);
/* cleanup */
SH_TextFragment_free (fragment);
SH_Data_free (data);
}
END_TEST
START_TEST(test_text_fragment_html_no_status)
{
struct SH_TextFragment * fragment;
......@@ -215,6 +238,7 @@ Suite * test_suite (void)
tcase_add_test (tc_core, test_text_fragment_with_status);
tcase_add_test (tc_core, test_text_fragment_copy_no_status);
tcase_add_test (tc_core, test_text_fragment_copy_with_status);
tcase_add_test (tc_core, test_text_fragment_get_text);
tcase_add_test (tc_core, test_text_fragment_html_no_status);
tcase_add_test (tc_core, test_text_fragment_html_with_status);
suite_add_tcase (s, tc_core);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment