mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #211] Wish: Slightly more flexible API #169
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pragmaware on GitHub (Dec 17, 2018).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/211
Originally assigned to: @jmcnamara on GitHub.
With the current API it's hard to wrap the workbook object in a freely usable C++ class.
It's also hard to gracefully handle write errors (like, say, write permission problems).
Suggested set of changes:
In this way one could create a Workbook class that wraps lxw_workbook, creates it in the constructor, frees it in the destructor and saves only when/if requested. The file can be composed and THEN the user can be asked for a filename. If the filename is not writable the user can be asked again and save can be attempted a second time. If the user aborts the procedure (by pressing cancel in the save dialog) the workbook can still be freed.
@jmcnamara commented on GitHub (Dec 17, 2018):
Hi,
Thanks for the suggestion.
You may already know this, but just as background to my answer, libxlsxwriter in a port of the Python library XlsxWriter which in turn is a port of the Perl library Excel::Writer::XLSX and I wrote all three.
The APIs are consistent across all the libraries (within the limits of the different languages). So, if I change it in one I need to change it in all three.
The addition of a
save()function was also requested, once or twice, for the Python library but I don't intend to add it since it could introduce a number of edge cases that weren't considered in the original design.So for now this is a "won't fix".
P.S., for a C++ wrapper check out the following: https://github.com/Alexhuszagh/libxlsxwriterpp
John