aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-05-16 23:19:34 +0100
committerAndy Williams <andy@andywilliams.me>2017-05-16 23:19:34 +0100
commitac076be75d125df9353c1a8cdcf970a9a01db370 (patch)
tree792f01bc80975c275be3e8c9b35636515fd02301 /src/lib/elementary
parentelm_code: Fix insertion of multiline content in widget (diff)
downloadefl-ac076be75d125df9353c1a8cdcf970a9a01db370.tar.gz
elm_code: Add a save_as API call for writing buffers to a new file
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_code_file.c10
-rw-r--r--src/lib/elementary/elm_code_file.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_code_file.c b/src/lib/elementary/elm_code_file.c
index 1094929f1a..97c36597fd 100644
--- a/src/lib/elementary/elm_code_file.c
+++ b/src/lib/elementary/elm_code_file.c
@@ -210,6 +210,16 @@ EAPI void elm_code_file_save(Elm_Code_File *file)
}
}
+EAPI void elm_code_file_save_as(Elm_Code_File *file, const char *path)
+{
+ Eina_File *newfile;
+ newfile = eina_file_open(path, EINA_FALSE);
+ file->file = newfile;
+ file->mime = efreet_mime_type_get(path);
+
+ elm_code_file_save(file);
+}
+
EAPI void elm_code_file_free(Elm_Code_File *file)
{
Elm_Code_Line *l;
diff --git a/src/lib/elementary/elm_code_file.h b/src/lib/elementary/elm_code_file.h
index 9bafe431ac..80842bf318 100644
--- a/src/lib/elementary/elm_code_file.h
+++ b/src/lib/elementary/elm_code_file.h
@@ -43,6 +43,8 @@ EAPI Elm_Code_File *elm_code_file_open(Elm_Code *code, const char *path);
EAPI void elm_code_file_save(Elm_Code_File *file);
+EAPI void elm_code_file_save_as(Elm_Code_File *file, const char *path);
+
EAPI void elm_code_file_free(Elm_Code_File *file);
EAPI void elm_code_file_close(Elm_Code_File *file);