mirror of https://github.com/tfussell/xlnt
Compare commits
1016 Commits
Author | SHA1 | Date |
---|---|---|
Thomas Fussell | 297b331435 | |
Thomas Fussell | 80a692725c | |
Thomas Fussell | 3c948d8555 | |
Thomas Fussell | a5bf4f57bd | |
Jonliu1993 | d9606cb0ae | |
Teebonne | f49bb7633e | |
Teebonne | e9f937eefc | |
Teebonne | d88a84ff1b | |
Teebonne | 9b752b7e0b | |
Teebonne | e55ac4f896 | |
Thomas Fussell | f0801fb7c7 | |
Thomas Fussell | 1cd5357ddb | |
Thomas Fussell | d62b267448 | |
Thomas Fussell | b96d986010 | |
Teebonne | 73f518ca98 | |
Teebonne | a6ff22e95b | |
Jonliu1993 | 381b33ecc7 | |
Teebonne | 707abfb941 | |
Teebonne | 73962b8a79 | |
Teebonne | 2137a7a243 | |
snippet | c21014c0fd | |
snippet | 1faa8b4990 | |
Thomas Fussell | fbae8cd6c1 | |
Thomas Fussell | 4c79627553 | |
Thomas Fussell | 5620e5be7a | |
Thomas Fussell | d45e831f47 | |
Thomas Fussell | c689943a63 | |
Thomas Fussell | a52bcd5fef | |
Thomas Fussell | f1107a5b0f | |
Thomas Fussell | 8a5f208b3a | |
Thomas Fussell | 1945691bb6 | |
Thomas Fussell | bf92dd7640 | |
Thomas Fussell | 69a20f3627 | |
Thomas Fussell | 5c2fdff70f | |
Thomas Fussell | 538f80794c | |
Blakjak88 | 6b5755af30 | |
Thomas Fussell | f3bbaa3eeb | |
Thomas Fussell | ef4dec6ebc | |
Thomas Fussell | 80cdf8ff46 | |
Thomas Fussell | 8b0cd6a935 | |
Thomas Fussell | c70abb76d3 | |
Thomas Fussell | 93a46a867d | |
dependabot[bot] | 772cd8e9d2 | |
dependabot[bot] | baa41b9722 | |
Thomas Fussell | fea07a81d3 | |
dependabot[bot] | d35868d70f | |
Thomas Fussell | 1d542f0d8b | |
dependabot[bot] | bf0018899d | |
Blakjak88 | dbfed051c8 | |
Markus Färber | cef67bdc45 | |
Darrell Wright | 4da810eaef | |
Thomas Fussell | d88c901faa | |
Thomas Fussell | 0246c7bece | |
Thomas Fussell | 69f651e3a1 | |
Thomas Fussell | 09dd4797b4 | |
Thomas Fussell | 0193ae7b37 | |
Thomas Fussell | 7e90dad59c | |
Félix Bourbonnais | 5ff980854a | |
Laurențiu Leahu-Vlăducu | 732cbe05b5 | |
Laurențiu Leahu-Vlăducu | 8c584321a5 | |
Félix Bourbonnais | 28f7e6fa69 | |
Thomas Fussell | 0cc90971b0 | |
Markus Werle | 919d341fb9 | |
Laurențiu Leahu-Vlăducu | 2f2e0a37a4 | |
Laurențiu Leahu-Vlăducu | 147307c90b | |
Laurențiu Leahu-Vlăducu | f6f4adca7d | |
Wu, Ganhao | c9d896c816 | |
Wu, Ganhao | b81d76a223 | |
Wu, Ganhao | 1be73c40f8 | |
Wu, Ganhao | 5946eec32e | |
Thomas Fussell | 3a279fcaab | |
Thomas Fussell | 94d784f68e | |
Thomas Fussell | a736834902 | |
Thomas Fussell | 10ff20c943 | |
Thomas Fussell | 50a792a01a | |
Thomas Fussell | bb7bc8c01d | |
Thomas Fussell | 04b6b97577 | |
Thomas Fussell | febb4c6043 | |
Thomas Fussell | 04ebd7ef9d | |
Vladimir S. Yakovlev | 99372e3f11 | |
Loren Burkholder | 5d89cf32c9 | |
Sewon Park | c160db4ef6 | |
vkovec | 4294e31253 | |
Thomas Fussell | 20f3dac28b | |
Thomas Fussell | 74fc642676 | |
Thomas Fussell | 7f51eed107 | |
Thomas Fussell | 70eb0d4e66 | |
Thomas Fussell | 65252b3a7d | |
Thomas Fussell | 705827c88e | |
Thomas Fussell | d0844421e5 | |
Thomas Fussell | 60b2d9cfd1 | |
Thomas Fussell | e15e47590c | |
Sewon Park | 7f44dc2274 | |
Thomas Fussell | e66e417b0c | |
Thomas Fussell | f0da7f61bb | |
Thomas Fussell | 7fca8fc9b9 | |
Thomas Fussell | 6987c1f233 | |
Thomas Fussell | a8b631bcbb | |
Thomas Fussell | c007dafe33 | |
Thomas Fussell | 1868128dda | |
Thomas Fussell | e53ef68469 | |
Thomas Fussell | 98e80133ae | |
Thomas Fussell | 23244120fb | |
Thomas Fussell | 35687270e5 | |
Thomas Fussell | 0039eab40d | |
Thomas Fussell | b9a1b48811 | |
Thomas Fussell | f99cf3bde0 | |
Thomas Fussell | 0f76a282ca | |
Thomas Fussell | c5d449915f | |
Thomas Fussell | 18e82f35d3 | |
Thomas Fussell | e9ec6a3dd1 | |
Thomas Fussell | 863372331f | |
Thomas Fussell | e6e00de51d | |
Thomas Fussell | bf90210d26 | |
Thomas Fussell | ca2abc9ddc | |
Thomas Fussell | 5b94bc60c0 | |
dependabot[bot] | 263678758c | |
Thomas Fussell | c448d9788a | |
Thomas Fussell | 059c3bd8cd | |
Thomas Fussell | 39071e6abe | |
Thomas Fussell | d913eec9f4 | |
Thomas Fussell | 4b91281280 | |
Thomas Fussell | 7e40e73601 | |
Thomas Fussell | 3f3bb97158 | |
Thomas Fussell | 647b5c07cb | |
Thomas Fussell | 90868bdb2a | |
Thomas Fussell | 10e0dd69f7 | |
Thomas Fussell | c31b2aa51d | |
Thomas Fussell | 71f00e8941 | |
Thomas Fussell | 08e51ccdc0 | |
Thomas Fussell | bfbfd6e94f | |
Thomas Fussell | f6e43a312d | |
Thomas Fussell | dd215794db | |
Thomas Fussell | 4bd0f4df56 | |
Thomas Fussell | 51406e4755 | |
Thomas Fussell | 566d83d447 | |
Thomas Fussell | b6d566f1f7 | |
Thomas Fussell | 140e280210 | |
Thomas Fussell | e702e7e68b | |
Thomas Fussell | 27e95fd7a8 | |
Thomas Fussell | e6ecd04265 | |
Thomas Fussell | 48b3fc7383 | |
Thomas Fussell | c89c4d951a | |
Thomas Fussell | ac771ac7e7 | |
Thomas Fussell | 3127e9c016 | |
Thomas Fussell | a96c288036 | |
Emmanuel Pescosta | 3225f357dd | |
Emmanuel Pescosta | 9df7c83ca6 | |
kira | 687af90735 | |
dependabot[bot] | a50ec35ded | |
胡剑波 | e9a9946856 | |
胡剑波 | dc9f550429 | |
胡剑波 | e8dd38d0d6 | |
胡剑波 | dafdfa3ebb | |
胡剑波 | 0ecad78c1d | |
Thomas Fussell | 3c7122a78c | |
胡剑波 | 4da7183b1c | |
Adam Hooper | 319c4197c1 | |
Stefan Rommel | cdb50bbd6b | |
Thomas Fussell | 8d2a8e161b | |
JCrawfy | 06801f7d36 | |
JCrawfy | 6c5a5a5dae | |
JCrawfy | f1042c5119 | |
JCrawfy | 504fed3585 | |
JCrawfy | 9d9d5de511 | |
JCrawfy | 556d3358e9 | |
JCrawfy | d30e705f83 | |
JCrawfy | dfb8f1518e | |
JCrawfy | 63484f8b8f | |
JCrawfy | 9136d21845 | |
JCrawfy | 1069c17fbe | |
JCrawfy | e8e29e9c18 | |
Thomas Fussell | d1d9553d4e | |
Joel Bodenmann | 4e0333ac91 | |
Thomas Fussell | 568ac85346 | |
Thomas Fussell | 05fb0ceaf6 | |
Thomas Fussell | 80b94549a7 | |
Thomas Fussell | 7c0d64248c | |
Thomas Fussell | b118d8f1f2 | |
Thomas Fussell | 7e1e8cb1a1 | |
Thomas Fussell | c3a1f1da95 | |
Thomas Fussell | 0f178e46c8 | |
Thomas Fussell | 138fb967bc | |
Thomas Fussell | 0a2a618663 | |
Thomas Fussell | a07c8c0c10 | |
Thomas Fussell | 8e451f24e3 | |
Thomas Fussell | 92577d6cac | |
Thomas Fussell | 5602edbd2d | |
Thomas Fussell | 9a18cd9fcd | |
Thomas Fussell | 252dd76616 | |
Thomas Fussell | 2f5934f60e | |
Thomas Fussell | 6c52e52487 | |
amiremohamadi | 3af9567946 | |
amiremohamadi | 33a56b3a04 | |
JCrawfy | f4d00acb9f | |
JCrawfy | e8cb8d9bc6 | |
JCrawfy | 0ea054026f | |
JCrawfy | c418c13010 | |
JCrawfy | 932fc4596f | |
JCrawfy | 39f498f401 | |
JCrawfy | ee593c2673 | |
JCrawfy | fbbf7ae767 | |
JCrawfy | 0915fde090 | |
JCrawfy | d135f35bd4 | |
JCrawfy | a5aca5c212 | |
JCrawfy | 7ba36b5e73 | |
JCrawfy | 0adb8a69b1 | |
Thomas Fussell | ae6f9d2324 | |
Adam Hooper | ac18fc6dde | |
Thomas Fussell | 0d1d85f181 | |
Thomas Fussell | e8ee585897 | |
Thomas Fussell | 5a2498c229 | |
Thomas Fussell | 53b2853ae3 | |
Thomas Fussell | 85e6878cc4 | |
Thomas Fussell | 39503e8bf0 | |
Thomas Fussell | 1a0c61f5b0 | |
Thomas Fussell | 8014e2fe19 | |
Thomas Fussell | 54e7c1df3d | |
Thomas Fussell | fcc2f0dddf | |
Thomas Fussell | a560756b35 | |
Thomas Fussell | dbc0ddd9bf | |
Thomas Fussell | e2262a0c65 | |
Thomas Fussell | edb27e84f8 | |
Johann1994 | d6262df555 | |
Johann1994 | 49663bc483 | |
Youngsuk Chung | 8e2f197f70 | |
Youngsuk Chung | c8bda73f01 | |
JCrawfy | f2ad495326 | |
JCrawfy | 613d7b6086 | |
JCrawfy | 97841413fa | |
JCrawfy | a25187f788 | |
JCrawfy | 7621b2807a | |
JCrawfy | d69a5dea75 | |
JCrawfy | 2eb88c23d6 | |
JCrawfy | a6fd7cc2b8 | |
JCrawfy | 2b61cac3dc | |
JCrawfy | 600cc9d000 | |
JCrawfy | 001606a77c | |
JCrawfy | 2307ed4edf | |
JCrawfy | a580079702 | |
JCrawfy | 96beae421f | |
JCrawfy | 9d687eaf49 | |
JCrawfy | e059d259c7 | |
JCrawfy | ea532c5c46 | |
JCrawfy | ad7933d783 | |
JCrawfy | c26a59f32e | |
JCrawfy | ec29e227d4 | |
JCrawfy | 8eda9f226f | |
JCrawfy | d83ed0b200 | |
JCrawfy | b27e7fe07e | |
JCrawfy | fa58994a14 | |
Matthew Albrecht | 9eee8ec0bb | |
Thomas Fussell | b22153180a | |
Thomas Fussell | a978e73354 | |
Thomas Fussell | a1d46694c1 | |
Thomas Fussell | 90ddaedc81 | |
Thomas Fussell | f30260153f | |
Alessandro Bettarini | 2b221fec81 | |
Thomas Fussell | df0626579b | |
Thomas Fussell | 5791ca80bf | |
Bob Apthorpe | bd84c7f576 | |
Thomas Fussell | cc88c4829b | |
Thomas Fussell | be7a91f7be | |
Thomas Fussell | ba01de47a7 | |
Thomas Fussell | 9f1b2ed4c8 | |
Thomas Fussell | 90b672cf6b | |
Thomas Fussell | 01cd2a3e3f | |
Thomas Fussell | 1e52c06376 | |
Thomas Fussell | 40baecdf02 | |
Thomas Fussell | 076c421a1f | |
Thomas Fussell | d5172d8bcd | |
Thomas Fussell | 7c9443dca9 | |
Thomas Fussell | 73b5a783a7 | |
Thomas Fussell | 123ecc95fe | |
Thomas Fussell | 1c22e9781e | |
Thomas Fussell | b6455ff6d1 | |
Thomas Fussell | f54a150589 | |
Thomas Fussell | e11188ccd1 | |
Thomas Fussell | b1a2f6d0bf | |
Thomas Fussell | 595397994f | |
Thomas Fussell | 938d99ddc5 | |
Thomas Fussell | 7e22fad735 | |
Thomas Fussell | 7d2a630e00 | |
Kostas Dizas | 38afc61219 | |
Kostas Dizas | d4b36b6582 | |
Kostas Dizas | 36d6b9823d | |
Kostas Dizas | 0897cc9fcb | |
Kostas Dizas | 38f12ff846 | |
Kostas Dizas | e9c23c3fc7 | |
Kostas Dizas | e9118cff24 | |
Kostas Dizas | 48a865cd66 | |
przemekmirek | 5a44433291 | |
Kostas Dizas | 03198f7e40 | |
Kostas Dizas | 5decf9cf89 | |
Kostas Dizas | dde45fd17f | |
Kostas Dizas | 3ab49c8af6 | |
Kostas Dizas | db5abec894 | |
Kostas Dizas | b6f0d0a7e1 | |
Kostas Dizas | 61639c7275 | |
Kostas Dizas | 698b40c54c | |
Kostas Dizas | 23fcfd636b | |
Crzyrndm | ed05bfeb44 | |
Crzyrndm | ab81bcaf08 | |
Kostas Dizas | c804b4c569 | |
Aaron Bishop | 0d76afb801 | |
Aaron Bishop | 37638f6d2b | |
Crzyrndm | e183e37ae6 | |
Crzyrndm | 1003ba507d | |
Crzyrndm | 875f143d74 | |
Crzyrndm | 4188d35caf | |
Crzyrndm | 9565377963 | |
Crzyrndm | a28f3fb7a9 | |
Crzyrndm | 9e78e55c62 | |
Crzyrndm | 61e46c934a | |
Crzyrndm | b2a514fdbf | |
Crzyrndm | 8b30319514 | |
Crzyrndm | d7603964e9 | |
Crzyrndm | 3a10e661b8 | |
Crzyrndm | edafcd1bb5 | |
Crzyrndm | 6aa10131a2 | |
Crzyrndm | 7b05beae90 | |
Crzyrndm | 19aad52500 | |
Crzyrndm | 3db87244f1 | |
Crzyrndm | 68589d91eb | |
Crzyrndm | 4487b988e7 | |
Aaron Bishop | ecf402972b | |
Crzyrndm | 10c5781e6d | |
Crzyrndm | 94fd22f492 | |
Crzyrndm | ca8c93c696 | |
Crzyrndm | 2d2f825f64 | |
Crzyrndm | 3ced259a26 | |
Crzyrndm | dc7f369be9 | |
Crzyrndm | c3296db932 | |
Crzyrndm | 544e90c975 | |
Crzyrndm | 3ae31fadc3 | |
Crzyrndm | e6a84c0cf0 | |
Crzyrndm | b4f695b3ea | |
Crzyrndm | 5a5db1a50b | |
Crzyrndm | f64dbc00c4 | |
Crzyrndm | 808765ea39 | |
Crzyrndm | ba54f9eaa3 | |
Crzyrndm | e01f461b64 | |
Crzyrndm | 4124dd78e0 | |
Crzyrndm | 9aff73747d | |
Crzyrndm | 475f9f35d0 | |
Crzyrndm | 6fb90ecf57 | |
Crzyrndm | dd6f338419 | |
Crzyrndm | 138c90883b | |
Crzyrndm | e350570ae6 | |
Crzyrndm | 6a4edfad40 | |
Crzyrndm | e0d5cdbd85 | |
Crzyrndm | 0fe0c20d2a | |
Crzyrndm | 6b427127ff | |
Crzyrndm | ecb71db558 | |
Crzyrndm | d93e470a52 | |
Crzyrndm | ade8cf3b6c | |
Crzyrndm | e1daff535c | |
Crzyrndm | d39b7a107a | |
Thomas Fussell | 94faf01b72 | |
Thomas Fussell | 8f39375f4c | |
Thomas Fussell | cbe50f4681 | |
Thomas Fussell | 0af7ad88e1 | |
Thomas Fussell | 8c29ebe738 | |
sukoi26 | 8f4248d9c3 | |
sukoi26 | 7be7172ff5 | |
sukoi26 | fe38e01341 | |
Crzyrndm | dd79946bf0 | |
Crzyrndm | 9e981abe05 | |
Crzyrndm | 6562c41ae1 | |
Crzyrndm | fede2d3168 | |
Crzyrndm | ad24d9485d | |
Crzyrndm | b004d0863c | |
Crzyrndm | 07d648fe8b | |
Crzyrndm | 34e8f274de | |
Crzyrndm | ad69e7bf11 | |
Crzyrndm | eda102ee9d | |
Crzyrndm | 761eee3e5f | |
Crzyrndm | 4dae88f004 | |
Crzyrndm | f035b9041e | |
Crzyrndm | 011ea3a9d2 | |
sukoi26 | 016c95bb4a | |
sukoi26 | a2dc4a34f1 | |
sukoi26 | 4f9e8ab37f | |
Crzyrndm | 0aee6fd9b1 | |
Crzyrndm | ad759ae4f7 | |
Crzyrndm | b9b47672ea | |
Crzyrndm | 5671167d1d | |
Crzyrndm | 25d75cb5c3 | |
Crzyrndm | 6b0fb72e78 | |
Crzyrndm | 11573f45e6 | |
Crzyrndm | ea850b32d5 | |
Crzyrndm | 9a33210144 | |
Crzyrndm | d4cc538faf | |
Crzyrndm | c94fc5a999 | |
Crzyrndm | ddab6551b0 | |
Crzyrndm | 03020cc793 | |
Crzyrndm | 054f509f7a | |
Crzyrndm | 1390d6a76e | |
Crzyrndm | 650bfeb7dd | |
Crzyrndm | f9b2ca5929 | |
Crzyrndm | 3d9e887d4a | |
Crzyrndm | 95ca51e5c8 | |
Crzyrndm | 49c4e725dc | |
Crzyrndm | 0d1bca3fd4 | |
Crzyrndm | 7458426111 | |
Crzyrndm | ec02121c15 | |
Crzyrndm | 53c193433f | |
Crzyrndm | dcf50cb4cd | |
Crzyrndm | cf8991a234 | |
Crzyrndm | 322490b397 | |
Crzyrndm | c0a90ccb7f | |
Crzyrndm | 24b4b6c628 | |
Crzyrndm | 54b1affd1e | |
Crzyrndm | b9fbe6241a | |
Crzyrndm | 1ab25fa7fc | |
Crzyrndm | 7160b7494d | |
Crzyrndm | ed84fe50d2 | |
sukoi26 | 28a71572cf | |
Crzyrndm | 399b5e3775 | |
Crzyrndm | cffb1ce345 | |
Crzyrndm | 0e69ea95bf | |
Crzyrndm | bf5105f0a3 | |
Crzyrndm | d603ee2106 | |
Crzyrndm | 4afc0963c6 | |
Crzyrndm | 9a82c4fab7 | |
Crzyrndm | b95919323d | |
Crzyrndm | 04b50d9b8e | |
Crzyrndm | a47985b2db | |
Crzyrndm | eaf3c2a773 | |
Crzyrndm | 62e0a7dd17 | |
Crzyrndm | bc8cd21d67 | |
Crzyrndm | 1e66824af0 | |
Crzyrndm | dc020622c0 | |
Crzyrndm | 1c4f9c7ed2 | |
Crzyrndm | 20e72d69e5 | |
Crzyrndm | 92ac3a2a2e | |
Joshua | 744dd0afbb | |
sukoi26 | 99f20a014a | |
Thomas Fussell | e1e4823908 | |
Crzyrndm | 51545734e8 | |
Crzyrndm | 03a56d8af9 | |
Crzyrndm | a7b167032b | |
Crzyrndm | a8fa6637fe | |
Crzyrndm | 4eecf84713 | |
Crzyrndm | 688c8c7f33 | |
Crzyrndm | fb195e2777 | |
Crzyrndm | bb04205dac | |
Crzyrndm | e0d62b0835 | |
Crzyrndm | 0325c19488 | |
Crzyrndm | 3d3a59012a | |
Crzyrndm | 4ff68319b0 | |
Crzyrndm | 8ba7f5b45d | |
Crzyrndm | fa19d8fccc | |
Crzyrndm | 49bd0c8fb4 | |
Crzyrndm | 840d1bcefc | |
Crzyrndm | a347d9c05d | |
Crzyrndm | 1c1d63498a | |
Crzyrndm | d12d2e450b | |
Crzyrndm | e8fcd49c0d | |
Crzyrndm | d2d0c2ab55 | |
Crzyrndm | 93323f334d | |
Crzyrndm | 7820ac548f | |
Crzyrndm | 884558fd15 | |
Crzyrndm | f62e5fe5f7 | |
Crzyrndm | d81555dbae | |
Crzyrndm | 4cfb74443c | |
Crzyrndm | 3eb06bac0d | |
Crzyrndm | fe90c9d488 | |
Crzyrndm | 07ea740d11 | |
Crzyrndm | fde3b90bda | |
Crzyrndm | 5817ef5cf0 | |
Crzyrndm | 5a14d7b9d1 | |
Crzyrndm | 1066b1007c | |
Crzyrndm | 15b3bd1b53 | |
Crzyrndm | 9bbebe5fdd | |
Crzyrndm | bd90cc4786 | |
Crzyrndm | 6d16ffaddf | |
Crzyrndm | cfef764ab9 | |
Crzyrndm | 92ae444791 | |
Crzyrndm | fa2b20da99 | |
Crzyrndm | fc7c69a724 | |
Crzyrndm | 6f13002ac6 | |
Crzyrndm | 4592b86746 | |
Crzyrndm | b4e7832419 | |
Crzyrndm | 04c0b4a1ca | |
Thomas Fussell | e350a7734d | |
Thomas Fussell | 6eb16243ca | |
Thomas Fussell | 78ae9bbb89 | |
Thomas Fussell | ec1584240c | |
Thomas Fussell | 50850ffb8a | |
Thomas Fussell | 617f7a2525 | |
Thomas Fussell | 410e73d594 | |
Thomas Fussell | 2426215801 | |
Andrii Tkachenko | e05ce8fdc1 | |
Andrii Tkachenko | 074b176d33 | |
Andrii Tkachenko | e37f9bed9d | |
Andrii Tkachenko | 51fbdbf56d | |
Andrii Tkachenko | 34362f6353 | |
Andrii Tkachenko | 467dc860c6 | |
Andrii Tkachenko | 27f37d3111 | |
Andrii Tkachenko | 7852a3c5dd | |
Andrii Tkachenko | 403605a536 | |
Andrii Tkachenko | cb55735644 | |
Andrii Tkachenko | 3246d602c2 | |
Andrii Tkachenko | 55cf7a2bed | |
Andrii Tkachenko | f460bb2678 | |
Andrii Tkachenko | 1aac106a40 | |
Andrii Tkachenko | 2459b336ef | |
Andrii Tkachenko | f918c6cfaf | |
Andrii Tkachenko | 1c50b35940 | |
Thomas Fussell | 0f0d3de75f | |
Thomas Fussell | 90633d0e8e | |
Thomas Fussell | c960453ff4 | |
Thomas Fussell | 44a8c8e79e | |
Thomas Fussell | 675a8fad8a | |
Thomas Fussell | 1c85188ec6 | |
Thomas Fussell | a653a39544 | |
Thomas Fussell | 182dea155b | |
Thomas Fussell | 842eedae8c | |
Thomas Fussell | 8bd85f9dbd | |
Thomas Fussell | 20c7d3437c | |
Thomas Fussell | e261743032 | |
tal | b008eacd89 | |
TataMata | d0bacf548c | |
fred.yan | 383337ad45 | |
TataMata | 8f9722686b | |
Bernard Čupić | 7cae301039 | |
sukoi26 | 4f07495abb | |
TataMata | 6b668fd04e | |
TataMata | b899c9db5c | |
sukoi26 | caeadfc83c | |
sukoi26 | 4a3e711a1b | |
Aaron Bishop | 0201f22237 | |
Thomas Fussell | c4a2bb8c6d | |
Thomas Fussell | 29abdfa702 | |
Thomas Fussell | 5b8820d2cd | |
Thomas Fussell | 470c655df6 | |
Thomas Fussell | dc4befd867 | |
Thomas Fussell | 06b315b352 | |
Thomas Fussell | 0e0bf0f8a1 | |
Alexandros Naskos | 7f08c77a90 | |
Thomas Fussell | 0dcd56ebc9 | |
Thomas Fussell | 75de03745b | |
Thomas Fussell | 34270f2333 | |
Thomas Fussell | e910666c56 | |
Thomas Fussell | 919c65ceea | |
vervbe | c05b9f33c1 | |
Thomas Fussell | 751599b44c | |
Thomas Fussell | 4c2c7a5859 | |
Thomas Fussell | b2adee9fd3 | |
Thomas Fussell | a9b1e2af4a | |
Thomas Fussell | f27df9732c | |
Thomas Fussell | 81812d6e29 | |
Thomas Fussell | 9d71dda531 | |
Thomas Fussell | bc1e3656c7 | |
Thomas Fussell | c214c6ca0b | |
Henrique Santiago | ea5c741bfe | |
Thomas Fussell | 985cfd28b4 | |
Thomas Fussell | 954f4b84cd | |
Thomas Fussell | bf3e278ea1 | |
Thomas Fussell | a21d659247 | |
Thomas Fussell | 299fc7d572 | |
Thomas Fussell | 94e19a6c70 | |
Thomas Fussell | b1aac2c863 | |
Thomas Fussell | 396e6eb948 | |
Thomas Fussell | 12007fe2d8 | |
Thomas Fussell | 7d0cf59286 | |
Thomas Fussell | 0d125b1534 | |
Thomas Fussell | fcd68dba8f | |
Thomas Fussell | 716a81a19f | |
Thomas Fussell | bbdace8b44 | |
Thomas Fussell | 85010f9f11 | |
Thomas Fussell | 53d7dbb67e | |
Thomas Fussell | b065cea22f | |
Thomas Fussell | 20d3a1dc98 | |
Thomas Fussell | fff2feccd2 | |
Thomas Fussell | 7ed14246b2 | |
Thomas Fussell | b7677d0783 | |
Thomas Fussell | b0b43f6d8e | |
Thomas Fussell | 50280ba2ab | |
sukoi26 | 60f3611c9c | |
Thomas Fussell | 2aaabb0579 | |
tal | 46a10cfb7b | |
sukoi26 | 8d85ed917f | |
Thomas Fussell | 25bb6bfadf | |
Thomas Fussell | f174dd825d | |
Thomas Fussell | cfe3934ab4 | |
sukoi26 | b21b856e68 | |
pebble2015 | 5461538396 | |
pebble2015 | 17ce83e612 | |
pebble2015 | f3d5d18035 | |
Chris | e5d6a26e17 | |
Chris | 5cc24fda39 | |
sukoi26 | f423c6e3fe | |
Thomas Fussell | 0ac12101fc | |
Thomas Fussell | 4e2c0c0ffb | |
Thomas Fussell | 49b84a83c7 | |
Thomas Fussell | c627db9984 | |
Thomas Fussell | 3257274057 | |
Thomas Fussell | b5e10a8dbe | |
Thomas Fussell | 60319c19d7 | |
Thomas Fussell | b54b2399d9 | |
Thomas Fussell | 5cefbc7dad | |
Thomas Fussell | 251387660f | |
Thomas Fussell | 8d9a4d5007 | |
Thomas Fussell | 474e802c40 | |
Thomas Fussell | 4cc9bee610 | |
Thomas Fussell | 7cc9898dab | |
Thomas Fussell | e3ba39681e | |
Thomas Fussell | 2aa9e62e62 | |
Thomas Fussell | 8801a0e352 | |
Thomas Fussell | de0e010056 | |
Thomas Fussell | eaaa310cef | |
Thomas Fussell | 8965cfa82c | |
Thomas Fussell | abdd1be7c8 | |
Thomas Fussell | ded81eab4a | |
Chris | 31611d85d5 | |
Thomas Fussell | 8d051e36e5 | |
Thomas Fussell | 7da9187808 | |
Thomas Fussell | b98f8c4fe7 | |
Thomas Fussell | 33399a5390 | |
Thomas Fussell | 5b95b3d463 | |
Thomas Fussell | 4367343e15 | |
Thomas Fussell | 1b7af5bccb | |
Thomas Fussell | c00a7a7798 | |
Thomas Fussell | 8e2486176e | |
Thomas Fussell | c00900e723 | |
Thomas Fussell | e991bbad43 | |
Thomas Fussell | e7af034e9e | |
Thomas Fussell | 99add77d98 | |
Thomas Fussell | 0f5a1f7f20 | |
Thomas Fussell | e16f5cfe51 | |
Thomas Fussell | bec125d5c9 | |
Thomas Fussell | 2949863c77 | |
Thomas Fussell | 7c333ad923 | |
Thomas Fussell | 0be7563f8b | |
Thomas Fussell | 13cfbe914f | |
Thomas Fussell | e6b0545c26 | |
Thomas Fussell | 5c033905fb | |
Thomas Fussell | fee2319093 | |
Thomas Fussell | e38b1cdd69 | |
Thomas Fussell | dfc5983155 | |
Thomas Fussell | 84a6fdcc14 | |
Thomas Fussell | 1709899373 | |
Thomas Fussell | 04b0d4e2ab | |
Thomas Fussell | 329fe488fe | |
Thomas Fussell | fa179d58ab | |
Thomas Fussell | 22325a2836 | |
Thomas Fussell | f97ad6c1bd | |
Thomas Fussell | 16bfbf78f5 | |
Thomas Fussell | bb96d01f49 | |
Thomas Fussell | 5e3476f755 | |
Thomas Fussell | dbe60a5227 | |
Thomas Fussell | 588809d74d | |
Thomas Fussell | 49f520a9ed | |
Thomas Fussell | 16683e4fbd | |
Thomas Fussell | dfa0ab6b69 | |
Thomas Fussell | f9c17bf075 | |
Thomas Fussell | 2aeec48b73 | |
Thomas Fussell | 80fb2a6e29 | |
Thomas Fussell | 6777982f08 | |
Thomas Fussell | da8fdf6667 | |
Thomas Fussell | 9f95894372 | |
Thomas Fussell | 498f3a6f71 | |
Thomas Fussell | aa8fc77964 | |
Thomas Fussell | 456b9bbd80 | |
Thomas Fussell | 7fb9df97be | |
Thomas Fussell | 245f5117d3 | |
Thomas Fussell | e104c6a9b6 | |
Thomas Fussell | 9861dc761a | |
Thomas Fussell | f502626418 | |
Thomas Fussell | 0ee0817757 | |
Thomas Fussell | c739eda35b | |
Thomas Fussell | 361078644e | |
Thomas Fussell | fa2e66ff2d | |
Thomas Fussell | 333e8c702f | |
Thomas Fussell | 9f9dfe7a75 | |
Thomas Fussell | d7b5374614 | |
Thomas Fussell | cf2dc9d7fb | |
Thomas Fussell | 56d744b6f9 | |
Thomas Fussell | fdd91f817f | |
Thomas Fussell | 6f716c6e89 | |
Thomas Fussell | 3153600768 | |
Thomas Fussell | 72b8bd6b67 | |
Thomas Fussell | b79221860c | |
Thomas Fussell | a9fd6b064e | |
Thomas Fussell | d7e7526beb | |
Thomas Fussell | eb201f5f70 | |
Thomas Fussell | 2305eae8b6 | |
Thomas Fussell | 7834b564f4 | |
Thomas Fussell | 7b391321f6 | |
Thomas Fussell | 342184139f | |
Thomas Fussell | 15492bdcc4 | |
Thomas Fussell | cae6276b23 | |
Thomas Fussell | d14f8c2e5f | |
Thomas Fussell | 9d312ee7f4 | |
Thomas Fussell | b3c044948f | |
Thomas Fussell | 2c5d579a1b | |
Thomas Fussell | d2be054b7c | |
Thomas Fussell | 4351dfd4ca | |
Thomas Fussell | b851d1c143 | |
Thomas Fussell | f0b1e789a3 | |
Thomas Fussell | 237fdcc84b | |
Thomas Fussell | 7ddd290e92 | |
Thomas Fussell | 4aff818a87 | |
Thomas Fussell | a37a1e102a | |
Timothy McCallum | e5da1f41cb | |
Timothy McCallum | 213c250751 | |
Timothy McCallum | 75052ac97a | |
Timothy McCallum | 06fb2cf812 | |
Timothy McCallum | 24ce486ebc | |
Timothy McCallum | 94c5ba2e15 | |
Thomas Fussell | e043aeaff7 | |
Timothy McCallum | 32dba95709 | |
Timothy McCallum | c430fca9ff | |
Timothy McCallum | b5997bd878 | |
Timothy McCallum | 4c5e5f3b2c | |
Thomas Fussell | f32859b257 | |
Thomas Fussell | 239c76659f | |
Timothy McCallum | 0dcdb01bf6 | |
Timothy McCallum | ed900e28dc | |
Timothy McCallum | 7298bc0d9d | |
Timothy McCallum | 356c851dfd | |
Thomas Fussell | a5c0d03bcc | |
Thomas Fussell | e26364c388 | |
Thomas Fussell | c677a14969 | |
Thomas Fussell | ee642fc6c1 | |
Timothy McCallum | e122494495 | |
Timothy McCallum | f3e475d4ae | |
Timothy McCallum | 292c7faea4 | |
Timothy McCallum | 30914a930f | |
Timothy McCallum | 0a6d093010 | |
Thomas Fussell | 4da901d387 | |
Thomas Fussell | b7bf16d47c | |
Timothy McCallum | 3ce51089cd | |
Thomas Fussell | f42d3eee74 | |
Thomas Fussell | f5b5d67594 | |
Thomas Fussell | be37df3c86 | |
Thomas Fussell | 6334907de7 | |
Timothy McCallum | 5268651937 | |
Timothy McCallum | 1214c4d2ce | |
Timothy McCallum | 133dbea920 | |
Thomas Fussell | a90b32f386 | |
Thomas Fussell | bb91308dd4 | |
Thomas Fussell | 1e1e8272ae | |
Thomas Fussell | 562e163bf6 | |
Thomas Fussell | be59d522a6 | |
Thomas Fussell | c642db6cc2 | |
Thomas Fussell | 16e1a1f124 | |
Thomas Fussell | 8f4f24c180 | |
Thomas Fussell | c020d31f58 | |
Thomas Fussell | 322190d386 | |
Thomas Fussell | 126f22816b | |
Thomas Fussell | 2fc692d694 | |
Thomas Fussell | be11002a93 | |
Thomas Fussell | f38dc4169b | |
Thomas Fussell | 89858e32b3 | |
Thomas Fussell | 3a57242b68 | |
Thomas Fussell | e2f733f6e0 | |
Thomas Fussell | e1bf1f6262 | |
Thomas Fussell | 4dedcd23dd | |
Thomas Fussell | b26d764624 | |
Thomas Fussell | b2a5110939 | |
Thomas Fussell | 8d1f044793 | |
c45d1e63e7 | ||
Thomas Fussell | 40ba1012b3 | |
Thomas Fussell | 868f661be7 | |
Thomas Fussell | 607e069b33 | |
Thomas Fussell | ff56701774 | |
Thomas Fussell | ca17462f43 | |
Thomas Fussell | 83ea1ff58e | |
Thomas Fussell | adda7b877a | |
Thomas Fussell | b3cc07e5db | |
Thomas Fussell | b0f1bf4b77 | |
Thomas Fussell | 28cee5f14b | |
Thomas Fussell | 05c1565a83 | |
Thomas Fussell | 3b2a0ac5d6 | |
Thomas Fussell | 104e3bea25 | |
Thomas Fussell | c68aa8fc84 | |
Thomas Fussell | 185d108e82 | |
Thomas Fussell | b85680c5ed | |
Thomas Fussell | 62f659b901 | |
Thomas Fussell | 835e36d6ae | |
Thomas Fussell | 46df18c12b | |
Thomas Fussell | 8bf7d0c7a6 | |
Thomas Fussell | 8b1c6c7465 | |
Thomas Fussell | 5b9304960c | |
Thomas Fussell | e465151dec | |
Thomas Fussell | 714ec4ed6f | |
Thomas Fussell | 529ca91a00 | |
Thomas Fussell | 40ccc283ee | |
Thomas Fussell | fb59d5b880 | |
Thomas Fussell | a3bfd86828 | |
Thomas Fussell | 5450a23be1 | |
Thomas Fussell | fd737912ce | |
Thomas Fussell | 4b174ab268 | |
Thomas Fussell | 05fb40438c | |
Thomas Fussell | cdcd49305d | |
Thomas Fussell | 04cc698416 | |
Thomas Fussell | 9fa9343d89 | |
Thomas Fussell | c902af7e17 | |
Thomas Fussell | ac768830bc | |
Thomas Fussell | 4c40651451 | |
Thomas Fussell | be0c1ac03a | |
Thomas Fussell | a7cd2c9ee5 | |
Thomas Fussell | 077e181617 | |
Thomas Fussell | 0d65569857 | |
Thomas Fussell | ea7b7074f0 | |
Thomas Fussell | 36dc88cf24 | |
Thomas Fussell | cc165dbb67 | |
Thomas Fussell | c57e1a2bbe | |
Thomas Fussell | 3e2a0fc15f | |
Thomas Fussell | 83cbc3f7eb | |
Thomas Fussell | fc4d284615 | |
Thomas Fussell | 116106d568 | |
Thomas Fussell | d54ddea5cc | |
Thomas Fussell | 9766daacd5 | |
Thomas Fussell | 83d2d18d1f | |
Thomas Fussell | c3d9b85530 | |
Thomas Fussell | 1121bcbe15 | |
Thomas Fussell | e040a1c4ab | |
Thomas Fussell | a11645b42a | |
Thomas Fussell | 7fc5033571 | |
Thomas Fussell | 5d6c5e9346 | |
Thomas Fussell | 9a3c215359 | |
Thomas Fussell | 6a893c954c | |
Thomas Fussell | 8a9e33d55c | |
Thomas Fussell | 4ca534a83a | |
Thomas Fussell | 31c152c9b6 | |
Thomas Fussell | 0d82aba640 | |
Thomas Fussell | c7f61e38c1 | |
Thomas Fussell | 0541b74c1f | |
Thomas Fussell | c9dc05597b | |
Thomas Fussell | 3cfcc7246c | |
Thomas Fussell | e7059d5475 | |
Thomas Fussell | 05dbd37e4f | |
Thomas Fussell | d6d726d391 | |
Thomas Fussell | dabd29fc59 | |
Thomas Fussell | c81378f6e1 | |
Thomas Fussell | 8d04b6501c | |
Thomas Fussell | dc0a8caa8b | |
Thomas Fussell | 638c1b0df4 | |
Thomas Fussell | 2627f729bd | |
Thomas Fussell | 86e39164a2 | |
Thomas Fussell | f7338e9afc | |
Thomas Fussell | 3b073a8b76 | |
Thomas Fussell | 658a0e05d0 | |
Thomas Fussell | ec65198255 | |
Thomas Fussell | b3e7cfda16 | |
Thomas Fussell | e13f0a6958 | |
Thomas Fussell | 9b82608ba0 | |
Thomas Fussell | 2fca439ca6 | |
Thomas Fussell | 470a571755 | |
Thomas Fussell | e8204133a9 | |
Thomas Fussell | fcf4d424ff | |
Thomas Fussell | 938990cee5 | |
Thomas Fussell | 3e89c3d196 | |
Thomas Fussell | 3feee30eac | |
Thomas Fussell | c448536e38 | |
Thomas Fussell | f6626e5079 | |
Thomas Fussell | b914b064b7 | |
Thomas Fussell | d8c9d14a98 | |
Thomas Fussell | 497699700f | |
Thomas Fussell | 6b119bec0c | |
Thomas Fussell | f862de1ff7 | |
Thomas Fussell | ea95c6d33b | |
Thomas Fussell | cf7f4e6c83 | |
Thomas Fussell | e617d140f0 | |
Thomas Fussell | e0e38a931c | |
Thomas Fussell | 7fa5099a49 | |
Thomas Fussell | f7db4b0248 | |
Thomas Fussell | 07001e0c07 | |
Thomas Fussell | 8066b853d7 | |
Thomas Fussell | 8f4c82dffd | |
Thomas Fussell | d7ee03d620 | |
Thomas Fussell | 21d05c4572 | |
Thomas Fussell | 9dccde4bff | |
Thomas Fussell | d7cd24c9f2 | |
Thomas Fussell | fe041b9aa1 | |
Thomas Fussell | c11fcd169e | |
Thomas Fussell | f908dca6fe | |
Thomas Fussell | c2365b3b31 | |
Thomas Fussell | 61bfdc2aee | |
Thomas Fussell | b2dbd2223b | |
Thomas Fussell | 98d5b64706 | |
Thomas Fussell | 5e60b61fe9 | |
Thomas Fussell | 2bbcb9f7bf | |
Thomas Fussell | f7e8e40ce2 | |
Thomas Fussell | eb078dce99 | |
Thomas Fussell | 11fb80ceaf | |
Thomas Fussell | af2005f41a | |
Thomas Fussell | 80c7664509 | |
Thomas Fussell | bb600ee1ce | |
Thomas Fussell | d991466e6f | |
Thomas Fussell | 70e520ef47 | |
Thomas Fussell | 92eaaeee85 | |
Thomas Fussell | 763504e532 | |
Thomas Fussell | 3b35dbb901 | |
Thomas Fussell | 5f9ab3a5f7 | |
Thomas Fussell | f42a0008b7 | |
Thomas Fussell | b404f36178 | |
Thomas Fussell | b4d84f29f1 | |
Thomas Fussell | e2f8720bb2 | |
Thomas Fussell | 924b5a4a71 | |
Thomas Fussell | ffc8c76f0a | |
Thomas Fussell | 4f47087d7e | |
Thomas Fussell | 77eeb3b567 | |
Thomas Fussell | db259e9422 | |
Thomas Fussell | e93e8ed091 | |
Thomas Fussell | 29ea2a4e99 | |
Thomas Fussell | daae577178 | |
Thomas Fussell | 11b92cf034 | |
Thomas Fussell | 192e0d87d6 | |
Thomas Fussell | 5b61145a0b | |
Thomas Fussell | 689bbee098 | |
sukoi26 | a6e9907b14 | |
Thomas Fussell | 9b4ef0db03 | |
Thomas Fussell | c87fdb1a1a | |
Thomas Fussell | 533a20bdc3 | |
Thomas Fussell | 4fdba1abce | |
Thomas Fussell | 8c16bd037f | |
Thomas Fussell | 2f9d35b983 | |
Thomas Fussell | 0aa26019e2 | |
sukoi26 | d9f755c67b | |
Thomas Fussell | 3883d8ae19 | |
Thomas Fussell | 273bb97bc3 | |
Thomas Fussell | 3db6cc8f0f | |
sukoi26 | fc1d73fee2 | |
Thomas Fussell | 65ad2466e1 | |
Thomas Fussell | ba533688c3 | |
Thomas Fussell | 9cdf31065c | |
Thomas Fussell | d7b0e252fd | |
Thomas Fussell | 0db50a7b15 | |
Thomas Fussell | 9535f94e38 | |
sukoi26 | fcb16ed655 | |
sukoi26 | 2daf1dd32a | |
sukoi26 | 07cefa4a2d | |
Thomas Fussell | 4ed8dae49c | |
Thomas Fussell | c01af37da3 | |
sukoi26 | 60459bcd25 | |
Thomas Fussell | 767d498dac | |
sukoi26 | b758b5f7e5 | |
sukoi26 | 6b9995be44 | |
sukoi26 | dc3decd0be | |
sukoi26 | bb8202f779 | |
sukoi26 | 8fa929256d | |
sukoi26 | 167c14e908 | |
sukoi26 | 0c517a9b0a | |
Thomas Fussell | 84011553a8 | |
Thomas Fussell | 81258f1498 | |
sukoi26 | b0664ded17 | |
sukoi26 | 4678048c21 | |
sukoi26 | 3fee3f0eb5 | |
sukoi26 | d7486830a6 | |
sukoi26 | 26eacce248 | |
Thomas Fussell | 85a3f2d60a | |
Thomas Fussell | 89be3d83df | |
Thomas Fussell | 101c36802e | |
Thomas Fussell | 5936b1e6af | |
sukoi26 | 09d9561683 | |
sukoi26 | 078fab6953 | |
sukoi26 | 833d5e81ae | |
sukoi26 | a1cf2fefd2 | |
sukoi26 | b83dcd6a1f | |
Thomas Fussell | e14e595b6a | |
Thomas Fussell | 9907f5a8c8 | |
Thomas Fussell | 82d5f623de | |
Thomas Fussell | 7a18c816b6 | |
alaw | 9262576f27 | |
Thomas Fussell | 0c100e166a | |
Thomas Fussell | 1858752a13 | |
Thomas Fussell | 0def63d86f | |
Thomas Fussell | e47baaf008 | |
Thomas Fussell | 7a991da9df | |
Thomas Fussell | 22c1f08b83 | |
Thomas Fussell | e4ec1a2850 | |
Thomas Fussell | a2bfdee2f2 | |
Thomas Fussell | 1d34d966a8 | |
Thomas Fussell | 472dd85026 | |
Thomas Fussell | 7e391d9ef2 | |
Thomas Fussell | 72470c6371 | |
Thomas Fussell | 13321a6740 | |
Thomas Fussell | 571c0103b5 | |
Thomas Fussell | f18e9dbc09 | |
Thomas Fussell | 753597510d | |
Thomas Fussell | 2991872778 | |
Thomas Fussell | 3acd06b857 | |
Thomas Fussell | bef9effa12 | |
Thomas Fussell | a66c0d1f3e | |
Thomas Fussell | ce138d71cd | |
Thomas Fussell | 7100b64e45 | |
Thomas Fussell | bc91bccc3a | |
Thomas Fussell | 90c7e929a9 | |
Thomas Fussell | 44b11d342c | |
Thomas Fussell | e9c8116b0d | |
Thomas Fussell | 1047a35581 | |
Thomas Fussell | a0dea36605 | |
Thomas Fussell | cc5952ec19 | |
Thomas Fussell | cc1a5e15f6 | |
sukoi26 | 32d3e7a61c | |
Thomas Fussell | 45428c7f2b | |
Thomas Fussell | c43561b4bd | |
Thomas Fussell | 34304fd9c7 | |
Thomas Fussell | 186ec184e2 | |
Thomas Fussell | e4d18b5603 | |
Thomas Fussell | ffdf570907 | |
Thomas Fussell | 8362913aa6 | |
Thomas Fussell | 78d67ec37d | |
Thomas Fussell | afbab819c4 | |
Thomas Fussell | 42c9233ad9 | |
Thomas Fussell | 913507dda6 | |
Thomas Fussell | 5ea76c7292 | |
Thomas Fussell | 2229c54427 | |
Thomas Fussell | 3215e3a472 | |
Thomas Fussell | 38cb446e3e | |
Thomas Fussell | ccd2a0eb1e |
|
@ -1,25 +1,36 @@
|
|||
version: '{build}'
|
||||
os: Previous Visual Studio 2015
|
||||
version: "{build}"
|
||||
os: Visual Studio 2015
|
||||
|
||||
cache:
|
||||
- vcpkg -> .appveyor.yml
|
||||
|
||||
platform:
|
||||
- x64
|
||||
|
||||
configuration:
|
||||
- Debug
|
||||
- Debug
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- STATIC: OFF
|
||||
- STATIC: ON
|
||||
- STATIC: OFF
|
||||
- STATIC: ON
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
init: []
|
||||
install: []
|
||||
|
||||
before_build:
|
||||
- git submodule update --init
|
||||
- cmake -H. -Bbuild -G"Visual Studio 14 2015 Win64" -DSTATIC=%STATIC% -DSAMPLES=ON -DBENCHMARKS=ON
|
||||
- git submodule update --init --recursive
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -G "Visual Studio 14 2015" -D CMAKE_GENERATOR_PLATFORM=%platform% -D STATIC=%STATIC% -D SAMPLES=ON -D BENCHMARKS=ON -D TESTS=ON ..
|
||||
|
||||
build:
|
||||
project: build/tests/xlnt.test.sln
|
||||
project: build/xlnt_all.sln
|
||||
parallel: true
|
||||
verbosity: minimal
|
||||
|
||||
test_script:
|
||||
- cd build/bin
|
||||
- xlnt.test.exe
|
||||
- tests\%configuration%\xlnt.test.exe
|
||||
- samples\%configuration%\sample-documentation.exe
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
version: 2.1
|
||||
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: lycantropos/cmake:3.9.5
|
||||
parameters:
|
||||
benchmarks:
|
||||
default: "OFF"
|
||||
type: string
|
||||
build-type:
|
||||
default: Release
|
||||
type: string
|
||||
coverage:
|
||||
default: "OFF"
|
||||
type: string
|
||||
cxx-ver:
|
||||
default: "11"
|
||||
type: string
|
||||
samples:
|
||||
default: "OFF"
|
||||
type: string
|
||||
static:
|
||||
default: "ON"
|
||||
type: string
|
||||
steps:
|
||||
- checkout
|
||||
- run: git submodule update --init --recursive
|
||||
- run: cmake -D XLNT_CXX_LANG=<< parameters.cxx-ver >> -D STATIC=<< parameters.static >> -D BENCHMARKS=<< parameters.benchmarks >> -D TESTS=ON -D SAMPLES=<< parameters.samples >> -D COVERAGE=<< parameters.coverage >> -D CMAKE_BUILD_TYPE=<< parameters.build-type >> .
|
||||
- run: cmake --build . -- -j2
|
||||
- run: ./tests/xlnt.test
|
||||
- when:
|
||||
condition:
|
||||
equal: ["ON", << parameters.samples >>]
|
||||
steps:
|
||||
- run: ./samples/sample-decrypt
|
||||
- run: ./samples/sample-img2xlsx ./samples/data/penguin.jpg img.xlsx
|
||||
- run: ./samples/sample-documentation
|
||||
- when:
|
||||
condition:
|
||||
equal: ["ON", << parameters.benchmarks >>]
|
||||
steps:
|
||||
- run: ./benchmarks/benchmark-styles
|
||||
- run: ./benchmarks/benchmark-writer
|
||||
- when:
|
||||
condition:
|
||||
equal: ["ON", << parameters.coverage >>]
|
||||
steps:
|
||||
- run: lcov --directory source/CMakeFiles/xlnt.dir --capture --output-file coverage.info --base-directory ../source --no-external --gcov-tool /usr/bin/gcov-6
|
||||
- run: lcov --output-file coverage.info --remove coverage.info source/detail/serialization/miniz.cpp
|
||||
- run: i=$(dirname $(pwd))
|
||||
- run: sed -i "s|$i/||" coverage.info
|
||||
- run: cd ..
|
||||
- run: coveralls-lcov build/coverage.info
|
||||
|
||||
workflows:
|
||||
build:
|
||||
jobs:
|
||||
- build:
|
||||
name: tests
|
||||
matrix:
|
||||
parameters:
|
||||
cxx-ver:
|
||||
- "11"
|
||||
- "17"
|
||||
build-type:
|
||||
- Release
|
||||
- Debug
|
||||
static:
|
||||
- "ON"
|
||||
- "OFF"
|
||||
- build:
|
||||
name: samples-benchmarks-coverage
|
||||
cxx-ver: "11"
|
||||
build-type: Debug
|
||||
static: "ON"
|
||||
samples: "ON"
|
||||
benchmarks: "ON"
|
||||
coverage: "OFF"
|
|
@ -1,8 +1,7 @@
|
|||
bin/
|
||||
lib/
|
||||
build/
|
||||
docs/_*/
|
||||
docs/build/
|
||||
docs/doxyxml/
|
||||
node_modules/
|
||||
*.obj
|
||||
*.sdf
|
||||
*.suo
|
||||
|
@ -12,3 +11,15 @@ docs/doxyxml/
|
|||
#*#
|
||||
*~
|
||||
.DS_Store
|
||||
__pycache__/
|
||||
Win32/
|
||||
*.pyd
|
||||
python/record.txt
|
||||
python/xlntpyarrow.egg-info/
|
||||
/x64/
|
||||
.envrc
|
||||
.vscode
|
||||
/dist/
|
||||
/.vs/
|
||||
/out/
|
||||
/CMakeSettings.json
|
||||
|
|
|
@ -1,32 +1,3 @@
|
|||
[submodule "third-party/libstudxml"]
|
||||
path = third-party/libstudxml
|
||||
url = http://scm.codesynthesis.com/libstudxml/libstudxml.git
|
||||
branch = master
|
||||
ignore = dirty
|
||||
|
||||
[submodule "third-party/cxxtest"]
|
||||
path = third-party/cxxtest
|
||||
url = https://github.com/CxxTest/cxxtest
|
||||
branch = master
|
||||
ignore = dirty
|
||||
|
||||
[submodule "third-party/utfcpp"]
|
||||
path = third-party/utfcpp
|
||||
url = https://github.com/nemtrif/utfcpp
|
||||
branch = master
|
||||
ignore = dirty
|
||||
|
||||
[submodule "third-party/botan"]
|
||||
path = third-party/botan
|
||||
url = https://github.com/randombit/botan
|
||||
branch = master
|
||||
ignore = dirty
|
||||
|
||||
[submodule "third-party/zlib"]
|
||||
path = third-party/zlib
|
||||
url = https://github.com/madler/zlib.git
|
||||
branch = develop
|
||||
ignore = dirty
|
||||
[submodule "third-party/cryptopp"]
|
||||
path = third-party/cryptopp
|
||||
url = https://github.com/weidai11/cryptopp
|
||||
path = third-party/libstudxml
|
||||
url = https://git.codesynthesis.com/libstudxml/libstudxml.git
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"git": {
|
||||
"commitMessage": "release v${version}",
|
||||
"requireBranch": "master",
|
||||
"requireCommits": true,
|
||||
"tagAnnotation": "release v${version}",
|
||||
"tagName": "v${version}"
|
||||
},
|
||||
"github": {
|
||||
"release": true,
|
||||
"releaseName": "xlnt v${version}"
|
||||
},
|
||||
"npm": {
|
||||
"publish": false
|
||||
},
|
||||
"plugins": {
|
||||
"@release-it/bumper": {
|
||||
"out": {
|
||||
"file": "source/CMakeLists.txt",
|
||||
"type": "text/plain"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
55
.travis.yml
55
.travis.yml
|
@ -1,55 +0,0 @@
|
|||
# from: https://github.com/nlohmann/json/blob/master/.travis.yml
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-4.9
|
||||
- python-pip
|
||||
before_script:
|
||||
- pip install --user git+git://github.com/eddyxu/cpp-coveralls.git
|
||||
env:
|
||||
- COMPILER=g++-4.9
|
||||
- COVERAGE=ON
|
||||
- STATIC=ON
|
||||
- SAMPLES=OFF
|
||||
- BENCHMARKS=OFF
|
||||
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-5
|
||||
- valgrind
|
||||
env:
|
||||
- COMPILER=g++-5
|
||||
- COVERAGE=OFF
|
||||
- STATIC=OFF
|
||||
- SAMPLES=ON
|
||||
- BENCHMARKS=ON
|
||||
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake -D STATIC=$STATIC -D BENCHMARKS=$BENCHMARKS -D SAMPLES=$SAMPLES -D COVERAGE=$COVERAGE -D CMAKE_CXX_COMPILER=$COMPILER -D CMAKE_BUILD_TYPE=Debug ..
|
||||
- cmake --build .
|
||||
- cd bin && ./xlnt.test
|
||||
- cd ..
|
||||
- find source/CMakeFiles/xlnt.dir
|
||||
- if [ "$COMPILER" = "g++4.9" ]; then coveralls --root source/CMakeFiles/xlnt.dir --verbose -x ".cpp" --gcov-options '\-p' ; fi
|
|
@ -4,7 +4,10 @@ It was initially inspired by the openpyxl library: https://openpyxl.readthedocs.
|
|||
|
||||
Thanks to everyone who has contributed to this project (in alphabetical order):
|
||||
|
||||
* adam-nielsen
|
||||
* Malvineous
|
||||
* sukoi26
|
||||
* tpmccallum
|
||||
* xpol
|
||||
|
||||
Project logo designed by Thomas Fussell.
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# Change Log
|
||||
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
Every release is documented on the Github [Releases](https://github.com/tfussell/xlnt/releases) page.
|
|
@ -1,37 +1,59 @@
|
|||
cmake_minimum_required(VERSION 3.1)
|
||||
set(LIBRARY_NAME xlnt)
|
||||
project(${LIBRARY_NAME}_all VERSION ${LIBRARY_VERSION} LANGUAGES CXX C)
|
||||
project(xlnt_all)
|
||||
|
||||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
||||
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
||||
|
||||
# CTest setup
|
||||
# include (CTest) # Add this for valgrind support; CTest works without it
|
||||
enable_testing()
|
||||
|
||||
# This indicates to CMakeLists in subdirectories that they are part of a larger project
|
||||
set(COMBINED_PROJECT 1)
|
||||
set(COMBINED_PROJECT TRUE)
|
||||
|
||||
# Library type
|
||||
option(STATIC "Set to ON to build ${PROJECT_NAME} as a static library instead of a shared library" OFF)
|
||||
option(STATIC "Set to ON to build xlnt as a static library instead of a shared library" OFF)
|
||||
|
||||
# c++ language standard to use
|
||||
set(XLNT_VALID_LANGS 11 14 17)
|
||||
set(XLNT_CXX_LANG "14" CACHE STRING "c++ language features to compile with")
|
||||
# enumerate allowed values for cmake gui
|
||||
set_property(CACHE XLNT_CXX_LANG PROPERTY STRINGS ${XLNT_VALID_LANGS})
|
||||
# validate value is in XLNT_VALID_LANGS
|
||||
list(FIND XLNT_VALID_LANGS ${XLNT_CXX_LANG} index)
|
||||
if(index EQUAL -1)
|
||||
message(FATAL_ERROR "XLNT_CXX_LANG must be one of ${XLNT_VALID_LANGS}")
|
||||
endif()
|
||||
|
||||
|
||||
# Optional components
|
||||
option(TESTS "Set to ON to build test executable (in ./tests)" OFF)
|
||||
option(SAMPLES "Set to ON to build executable code samples (in ./samples)" OFF)
|
||||
option(BENCHMARKS "Set to ON to build performance benchmarks (in ./benchmarks)" OFF)
|
||||
option(PYTHON "Set to ON to build Arrow conversion functions (in ./python)" OFF)
|
||||
|
||||
# Platform specific options
|
||||
if(NOT MSVC)
|
||||
option(COVERAGE "Generate coverage data using gcov" OFF)
|
||||
if(MSVC)
|
||||
option(STATIC_CRT "Link with the static version of MSVCRT (/MD[d])" OFF)
|
||||
else()
|
||||
option(COVERAGE "Generate coverage data using gcov" OFF)
|
||||
endif()
|
||||
|
||||
# Add components according to selected options
|
||||
if(SAMPLES)
|
||||
add_subdirectory(samples)
|
||||
add_subdirectory(samples)
|
||||
endif()
|
||||
|
||||
if(BENCHMARKS)
|
||||
add_subdirectory(benchmarks)
|
||||
add_subdirectory(benchmarks)
|
||||
endif()
|
||||
|
||||
find_package(PythonInterp)
|
||||
if(TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if(PYTHONINTERP_FOUND)
|
||||
add_subdirectory(tests)
|
||||
else()
|
||||
message("Python couldn't be found in the current PATH but is required for building tests. Tests will be skipped for now.")
|
||||
if(PYTHON)
|
||||
add_subdirectory(python)
|
||||
endif()
|
||||
|
||||
add_subdirectory(source)
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at thomas.fussell@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
369
LICENSE.md
369
LICENSE.md
|
@ -1,7 +1,10 @@
|
|||
This software is distributed under the MIT Licence
|
||||
==================================================
|
||||
# License
|
||||
|
||||
Copyright (c) 2014-2015 Thomas Fussell
|
||||
## [xlnt](https://github.com/tfussell/xlnt)
|
||||
>[MIT License](https://github.com/tfussell/xlnt/blob/master/LICENSE.md)
|
||||
|
||||
```
|
||||
Copyright (c) 2014-2018 Thomas Fussell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
|
@ -21,14 +24,43 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
# Dependency Licences
|
||||
|
||||
Third-party licenses
|
||||
====================
|
||||
## [utfcpp](https://github.com/nemtrif/utfcpp)
|
||||
>[Boost Software License - Version 1.0](https://github.com/nemtrif/utfcpp/blob/master/source/utf8.h)
|
||||
|
||||
Pole is distributed under the BSD 2-Clause License
|
||||
==================================================
|
||||
```
|
||||
Copyright 2006 Nemanja Trifunovic
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## [POLE](http://www.dimin.net/software/pole/)
|
||||
>[BSD 2-Clause License](https://bitbucket.org/dimin/pole/src/c15e513bdce4c3a52b3dbc925d4d2bb520dc71d8/pole/LICENSE)
|
||||
|
||||
```
|
||||
POLE - Portable C++ library to access OLE Storage
|
||||
Copyright (C) 2002-2007 Ariya Hidayat (ariya@kde.org). All rights reserved.
|
||||
|
||||
|
@ -52,37 +84,12 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
```
|
||||
|
||||
## [libstudxml](http://www.codesynthesis.com/projects/libstudxml/)
|
||||
>[MIT License](http://www.codesynthesis.com/licenses/mit.txt)
|
||||
|
||||
Crypto++ is distributed under the Boost Software License - Version 1.0
|
||||
======================================================================
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
libstudxml is distributed under the MIT License
|
||||
===============================================
|
||||
|
||||
```
|
||||
Summary: Everything is licensed under the MIT License (text below).
|
||||
|
||||
Code found in the xml/details/expat/ directory is distributed under
|
||||
|
@ -114,91 +121,210 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## [PartIO](https://www.disneyanimation.com/technology/partio.html)
|
||||
>[BSD 3-Clause License (with specific non-attribution clause)](https://github.com/wdas/partio/blob/master/src/lib/io/ZIP.h)
|
||||
|
||||
pugixml is distributed under the MIT License
|
||||
============================================
|
||||
```
|
||||
Copyright 2010 Disney Enterprises, Inc. All rights reserved
|
||||
|
||||
Copyright (c) 2006-2016 Arseny Kapoulkine
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* The names "Disney", "Walt Disney Pictures", "Walt Disney Animation
|
||||
Studios" or the names of its contributors may NOT be used to
|
||||
endorse or promote products derived from this software without
|
||||
specific prior written permission from Walt Disney Pictures.
|
||||
|
||||
Disclaimer: THIS SOFTWARE IS PROVIDED BY WALT DISNEY PICTURES AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL WALT DISNEY PICTURES, THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND BASED ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
```
|
||||
|
||||
## [miniz](https://github.com/richgel999/miniz)
|
||||
>[Public Domain/MIT License](https://github.com/richgel999/miniz/blob/master/LICENSE)
|
||||
|
||||
```
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org/>
|
||||
|
||||
zlib is distributed under the zlib license
|
||||
==========================================
|
||||
Copyright 2013-2014 RAD Game Tools and Valve Software
|
||||
Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
|
||||
All Rights Reserved.
|
||||
|
||||
(C) 1995-2013 Jean-loup Gailly and Mark Adler
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
|
||||
|
||||
utfcpp is distributed under the Boost Software License - Version 1.0
|
||||
====================================================================
|
||||
|
||||
Copyright 2006 Nemanja Trifunovic
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
```
|
||||
|
||||
|
||||
CxxTest is distributed under the LGPL License
|
||||
=============================================
|
||||
## [SHA-512 hash in C](https://www.nayuki.io/page/fast-sha2-hashes-in-x86-assembly)
|
||||
>[MIT License](https://www.nayuki.io/res/fast-sha2-hashes-in-x86-assembly/sha512.c)
|
||||
|
||||
```
|
||||
Copyright (c) 2016 Project Nayuki
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## [SHA-1 hash in C](https://www.nayuki.io/page/fast-sha1-hash-implementation-in-x86-assembly)
|
||||
>[MIT License](https://www.nayuki.io/res/fast-sha1-hash-implementation-in-x86-assembly/sha1-fast.c)
|
||||
|
||||
```
|
||||
Copyright (c) 2014 Project Nayuki
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## [LibTomCrypt](http://www.libtom.net/)
|
||||
>[Public Domain](https://github.com/libtom/libtomcrypt/blob/develop/LICENSE)
|
||||
|
||||
```
|
||||
LibTomCrypt is public domain. As should all quality software be.
|
||||
|
||||
Tom St Denis
|
||||
```
|
||||
|
||||
# Dependency Licences (Python Module)
|
||||
|
||||
## [pybind11](https://github.com/pybind/pybind11)
|
||||
>[BSD 3-Clause License](https://github.com/pybind/pybind11/blob/master/LICENSE)
|
||||
|
||||
```
|
||||
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
You are under no obligation whatsoever to provide any bug fixes, patches, or
|
||||
upgrades to the features, functionality or performance of the source code
|
||||
("Enhancements") to anyone; however, if you choose to make your Enhancements
|
||||
available either publicly, or directly to the author of this software, without
|
||||
imposing a separate written license agreement for such Enhancements, then you
|
||||
hereby grant the following license: a non-exclusive, royalty-free perpetual
|
||||
license to install, use, modify, prepare derivative works, incorporate into
|
||||
other computer software, distribute, and sublicense such enhancements or
|
||||
derivative works thereof, in binary and source code form.
|
||||
```
|
||||
|
||||
|
||||
# Dependency Licences (Testing Only)
|
||||
|
||||
## [CxxTest](http://cxxtest.com/)
|
||||
>[LGPL License](https://github.com/CxxTest/cxxtest/blob/master/COPYING)
|
||||
|
||||
```
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
|
@ -364,39 +490,4 @@ whether future versions of the GNU Lesser General Public License shall
|
|||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
||||
|
||||
|
||||
partio is distributed under the BSD 3-Clause License (with specific non-attribution clause)
|
||||
===========================================================================================
|
||||
|
||||
Copyright 2010 Disney Enterprises, Inc. All rights reserved
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* The names "Disney", "Walt Disney Pictures", "Walt Disney Animation
|
||||
Studios" or the names of its contributors may NOT be used to
|
||||
endorse or promote products derived from this software without
|
||||
specific prior written permission from Walt Disney Pictures.
|
||||
|
||||
Disclaimer: THIS SOFTWARE IS PROVIDED BY WALT DISNEY PICTURES AND
|
||||
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL WALT DISNEY PICTURES, THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND BASED ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
```
|
||||
|
|
81
README.md
81
README.md
|
@ -1,24 +1,24 @@
|
|||
<img height="100" src="https://raw.githubusercontent.com/tfussell/xlnt/gh-pages/images/xlnt.png" alt="xlnt"><br/>
|
||||
<img height="100" src="https://user-images.githubusercontent.com/1735211/29433390-f37fa28e-836c-11e7-8a60-f8df4c30b424.png" alt="xlnt logo"><br/>
|
||||
====
|
||||
|
||||
[![Travis Build Status](https://travis-ci.org/tfussell/xlnt.svg)](https://travis-ci.org/tfussell/xlnt)
|
||||
[![Travis Build Status](https://travis-ci.org/tfussell/xlnt.svg?branch=master)](https://travis-ci.org/tfussell/xlnt)
|
||||
[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/2hs79a1xoxy16sol?svg=true)](https://ci.appveyor.com/project/tfussell/xlnt)
|
||||
[![Coverage Status](https://coveralls.io/repos/github/tfussell/xlnt/badge.svg?branch=master)](https://coveralls.io/github/tfussell/xlnt?branch=master)
|
||||
[![ReadTheDocs Documentation Status](https://readthedocs.org/projects/xlnt/badge/?version=latest)](http://xlnt.readthedocs.org/en/latest/?badge=latest)
|
||||
[![Documentation Status](https://legacy.gitbook.com/button/status/book/tfussell/xlnt)](https://tfussell.gitbooks.io/xlnt/content/)
|
||||
[![License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://opensource.org/licenses/MIT)
|
||||
|
||||
## Introduction
|
||||
xlnt is a C++14 library for reading, writing, and modifying xlsx files as described in [ECMA 376 4th edition](http://www.ecma-international.org/publications/standards/Ecma-376.htm). The API was initially based on [openpyxl](https://bitbucket.org/openpyxl/openpyxl), a Python library to read/write Excel 2007 xlsx/xlsm files, which was itself based on [PHPExcel](https://github.com/PHPOffice/PHPExcel), pure PHP library for reading and writing spreadsheet files. xlnt is still very much a work in progress, but the core development work is complete. For a high-level summary of what you can do with this library, see [here](http://xlnt.readthedocs.io/en/latest/#summary-of-features).
|
||||
xlnt is a modern C++ library for manipulating spreadsheets in memory and reading/writing them from/to XLSX files as described in [ECMA 376 4th edition](http://www.ecma-international.org/publications/standards/Ecma-376.htm). The first public release of xlnt version 1.0 was on May 10th, 2017. Current work is focused on increasing compatibility, improving performance, and brainstorming future development goals. For a high-level summary of what you can do with this library, see [the feature list](https://tfussell.gitbooks.io/xlnt/content/docs/introduction/Features.html). Contributions are welcome in the form of pull requests or discussions on [the repository's Issues page](https://github.com/tfussell/xlnt/issues).
|
||||
|
||||
## Example
|
||||
|
||||
Including xlnt in your project, creating a new spreadsheet, and saving it as "example.xlsx"
|
||||
|
||||
## Usage
|
||||
Including xlnt in your project
|
||||
```c++
|
||||
// with -std=c++14 -Ixlnt/include -Lxlnt/lib -lxlnt
|
||||
#include <xlnt/xlnt.hpp>
|
||||
```
|
||||
|
||||
Creating a new spreadsheet and saving it as "example.xlsx"
|
||||
```c++
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
xlnt::worksheet ws = wb.active_sheet();
|
||||
ws.cell("A1").value(5);
|
||||
|
@ -27,53 +27,26 @@ Creating a new spreadsheet and saving it as "example.xlsx"
|
|||
ws.merge_cells("C3:C4");
|
||||
ws.freeze_panes("B2");
|
||||
wb.save("example.xlsx");
|
||||
```
|
||||
|
||||
## Building
|
||||
xlnt uses continous integration (thanks [Travis CI](https://travis-ci.org/) and [AppVeyor](https://www.appveyor.com/)!) and passes all 270+ tests in GCC 4, GCC 5, VS2015 U3, and Clang (using Apple LLVM 8.0). Build configurations for Visual Studio 2015, GNU Make, and Xcode can be created using [cmake](https://cmake.org/) v3.1+. A full list of cmake generators can be found [here](https://cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html). A basic build would look like (starting in the root xlnt directory):
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j8
|
||||
```
|
||||
|
||||
The resulting shared (e.g. libxlnt.dylib) library would be found in the build/lib directory. Other cmake configuration options for xlnt can be found using "cmake -LH". These options include building a static library instead of shared and whether to build sample executables or not. An example of building a static library with an Xcode project:
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -D STATIC=ON -G Xcode ..
|
||||
cmake --build .
|
||||
cd bin && ./xlnt.test
|
||||
```
|
||||
*Note for Windows: cmake defaults to building a 32-bit library project. To build a 64-bit library, use the Win64 generator*
|
||||
```bash
|
||||
cmake -G "Visual Studio 14 2015 Win64" ..
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
xlnt requires the following libraries which are all distributed under permissive open source licenses. All libraries are included in the source tree as [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules#Cloning-a-Project-with-Submodules) for convenience except for pole and partio's zip component which have been modified and reside in xlnt/source/detail:
|
||||
- [zlib v1.2.8](http://zlib.net/) (zlib License)
|
||||
- [libstudxml v1.1.0](http://www.codesynthesis.com/projects/libstudxml/) (MIT license)
|
||||
- [utfcpp v2.3.4](http://utfcpp.sourceforge.net/) (Boost Software License, Version 1.0)
|
||||
- [Crypto++ v5.6.5](https://www.cryptopp.com/) (Boost Software License, Version 1.0)
|
||||
- [pole v0.5](https://github.com/catlan/pole) (BSD 2-Clause License)
|
||||
- [partio v1.1.0](https://github.com/wdas/partio) (BSD 3-Clause License with specific non-attribution clause)
|
||||
|
||||
Additionally, the xlnt test suite (bin/xlnt.test) requires an extra testing library. This test executable is separate from the main xlnt library assembly so the terms of this library's license should not apply to users of solely the xlnt library:
|
||||
- [cxxtest v4.4](http://cxxtest.com/) (LGPLv3 License)
|
||||
|
||||
Initialize the submodules from the HEAD of their respective Git repositories with this command called from the xlnt root directory:
|
||||
```bash
|
||||
git submodule update --init --remote
|
||||
return 0;
|
||||
}
|
||||
// compile with -std=c++14 -Ixlnt/include -lxlnt
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
More detailed documentation with examples can be found on [Read The Docs](http://xlnt.readthedocs.org/en/latest/) (Warning: As of November 9, 2016 this is very out of date).
|
||||
Documentation for the current release of xlnt is available [here](https://tfussell.gitbooks.io/xlnt/content/).
|
||||
|
||||
## Building xlnt - Using vcpkg
|
||||
|
||||
You can download and install xlnt using the [vcpkg](https://github.com/microsoft/vcpkg) dependency manager:
|
||||
|
||||
git clone https://github.com/microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
./bootstrap-vcpkg.sh
|
||||
./vcpkg integrate install
|
||||
./vcpkg install xlnt
|
||||
|
||||
The xlnt port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/microsoft/vcpkg) on the vcpkg repository.
|
||||
|
||||
## License
|
||||
xlnt is released to the public for free under the terms of the MIT License. See [LICENSE.md](https://github.com/tfussell/xlnt/blob/master/LICENCE.md) for the full text of the license and the licenses of xlnt's third-party dependencies. [LICENSE.md](https://github.com/tfussell/xlnt/blob/master/LICENCE.md) should be distributed alongside any assemblies that use xlnt in source or compiled form.
|
||||
|
||||
xlnt is released to the public for free under the terms of the MIT License. See [LICENSE.md](https://github.com/tfussell/xlnt/blob/master/LICENSE.md) for the full text of the license and the licenses of xlnt's third-party dependencies. [LICENSE.md](https://github.com/tfussell/xlnt/blob/master/LICENSE.md) should be distributed alongside any assemblies that use xlnt in source or compiled form.
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
docs/README.md
|
|
@ -1,29 +1,48 @@
|
|||
cmake_minimum_required(VERSION 3.1)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/common.cmake)
|
||||
project(${LIBRARY_NAME}.benchmarks VERSION ${LIBRARY_VERSION} LANGUAGES CXX)
|
||||
project(xlnt.benchmarks)
|
||||
|
||||
# Require C++11 compiler
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
if(NOT COMBINED_PROJECT)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
|
||||
# Include xlnt library
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
|
||||
endif()
|
||||
|
||||
include_directories(${LIBRARY_INCLUDE_DIR})
|
||||
|
||||
file(GLOB SAMPLE_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
|
||||
if(NOT MSVC)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
if(STATIC_CRT)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/ucm.cmake)
|
||||
ucm_set_runtime(STATIC)
|
||||
endif()
|
||||
|
||||
foreach(SAMPLE_SOURCE IN ITEMS ${SAMPLE_SOURCES})
|
||||
get_filename_component(SAMPLE_NAME ${SAMPLE_SOURCE} NAME_WE)
|
||||
set(SAMPLE_EXECUTABLE benchmark-${SAMPLE_NAME})
|
||||
add_executable(${SAMPLE_EXECUTABLE} ${SAMPLE_SOURCE})
|
||||
target_link_libraries(${SAMPLE_EXECUTABLE} ${LIBRARY_NAME})
|
||||
if(NOT MSVC)
|
||||
target_link_libraries(${SAMPLE_EXECUTABLE} Threads::Threads)
|
||||
endif()
|
||||
set(XLNT_BENCHMARK_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/data)
|
||||
|
||||
file(GLOB BENCHMARK_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
|
||||
foreach(BENCHMARK_SOURCE IN ITEMS ${BENCHMARK_SOURCES})
|
||||
# Convert <name>.cpp to benchmark-<name>
|
||||
get_filename_component(BENCHMARK_NAME ${BENCHMARK_SOURCE} NAME_WE)
|
||||
set(BENCHMARK_EXECUTABLE benchmark-${BENCHMARK_NAME})
|
||||
|
||||
add_executable(${BENCHMARK_EXECUTABLE} ${BENCHMARK_SOURCE})
|
||||
|
||||
target_link_libraries(${BENCHMARK_EXECUTABLE} PRIVATE xlnt)
|
||||
# Need to use some test helpers
|
||||
target_include_directories(${BENCHMARK_EXECUTABLE}
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../tests)
|
||||
target_compile_definitions(${BENCHMARK_EXECUTABLE}
|
||||
PRIVATE XLNT_BENCHMARK_DATA_DIR=${XLNT_BENCHMARK_DATA_DIR})
|
||||
|
||||
if(MSVC AND NOT STATIC)
|
||||
# Copy xlnt DLL into benchmarks directory
|
||||
add_custom_command(TARGET ${BENCHMARK_EXECUTABLE} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
$<TARGET_FILE:xlnt>
|
||||
$<TARGET_FILE_DIR:${BENCHMARK_EXECUTABLE}>)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/data
|
||||
DESTINATION ${CMAKE_BINARY_DIR}/bin)
|
||||
option(XLNT_MICROBENCH_ENABLED "Enable small benchmarks typically used for development" OFF)
|
||||
if (XLNT_MICROBENCH_ENABLED)
|
||||
add_subdirectory(microbenchmarks)
|
||||
endif()
|
|
@ -0,0 +1,36 @@
|
|||
# FetchContent added in cmake v3.11
|
||||
# https://cmake.org/cmake/help/v3.11/module/FetchContent.html
|
||||
# this file is behind a feature flag (XLNT_MICROBENCH_ENABLED) so the primary build is not affected
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
project(xlnt_ubench)
|
||||
|
||||
# acquire google benchmark dependency
|
||||
# disable generation of the various test projects
|
||||
set(BENCHMARK_ENABLE_TESTING OFF)
|
||||
# gtest not required
|
||||
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
googlebenchmark
|
||||
GIT_REPOSITORY https://github.com/google/benchmark
|
||||
GIT_TAG v1.5.0
|
||||
)
|
||||
# download if not already present
|
||||
FetchContent_GetProperties(googlebenchmark)
|
||||
if(NOT googlebenchmark_POPULATED)
|
||||
FetchContent_Populate(googlebenchmark)
|
||||
add_subdirectory(${googlebenchmark_SOURCE_DIR} ${googlebenchmark_BINARY_DIR})
|
||||
endif()
|
||||
# equivalent of add_subdirectory, now available for use
|
||||
FetchContent_MakeAvailable(googlebenchmark)
|
||||
|
||||
|
||||
add_executable(xlnt_ubench)
|
||||
target_sources(xlnt_ubench
|
||||
PRIVATE
|
||||
string_to_double.cpp
|
||||
double_to_string.cpp
|
||||
)
|
||||
target_link_libraries(xlnt_ubench benchmark_main xlnt)
|
||||
target_compile_features(xlnt_ubench PRIVATE cxx_std_17)
|
|
@ -0,0 +1,207 @@
|
|||
// A core part of the xlsx serialisation routine is taking doubles from memory and stringifying them
|
||||
// this has a few requirements
|
||||
// - expect strings in the form 1234.56 (i.e. no thousands seperator, '.' used for the decimal seperator)
|
||||
// - outputs up to 15 significant figures (excel only serialises numbers up to 15sf)
|
||||
|
||||
#include "benchmark/benchmark.h"
|
||||
#include <locale>
|
||||
#include <random>
|
||||
#include <sstream>
|
||||
|
||||
namespace {
|
||||
|
||||
// setup a large quantity of random doubles as strings
|
||||
template <bool Decimal_Locale = true>
|
||||
class RandomFloats : public benchmark::Fixture
|
||||
{
|
||||
static constexpr size_t Number_of_Elements = 1 << 20;
|
||||
static_assert(Number_of_Elements > 1'000'000, "ensure a decent set of random values is generated");
|
||||
|
||||
std::vector<double> inputs;
|
||||
|
||||
size_t index = 0;
|
||||
const char *locale_str = nullptr;
|
||||
|
||||
public:
|
||||
void SetUp(const ::benchmark::State &state)
|
||||
{
|
||||
if (Decimal_Locale)
|
||||
{
|
||||
locale_str = setlocale(LC_ALL, "C");
|
||||
}
|
||||
else
|
||||
{
|
||||
locale_str = setlocale(LC_ALL, "de-DE");
|
||||
}
|
||||
std::random_device rd; // obtain a seed for the random number engine
|
||||
std::mt19937 gen(rd());
|
||||
// doing full range is stupid (<double>::min/max()...), it just ends up generating very large numbers
|
||||
// uniform is probably not the best distribution to use here, but it will do for now
|
||||
std::uniform_real_distribution<double> dis(-1'000, 1'000);
|
||||
// generate a large quantity of doubles to deserialise
|
||||
inputs.reserve(Number_of_Elements);
|
||||
for (int i = 0; i < Number_of_Elements; ++i)
|
||||
{
|
||||
double d = dis(gen);
|
||||
inputs.push_back(d);
|
||||
}
|
||||
}
|
||||
|
||||
void TearDown(const ::benchmark::State &state)
|
||||
{
|
||||
// restore locale
|
||||
setlocale(LC_ALL, locale_str);
|
||||
// gbench is keeping the fixtures alive somewhere, need to clear the data after use
|
||||
inputs = std::vector<double>{};
|
||||
}
|
||||
|
||||
double &get_rand()
|
||||
{
|
||||
return inputs[++index & (Number_of_Elements - 1)];
|
||||
}
|
||||
};
|
||||
|
||||
/// Takes in a double and outputs a string form of that number which will
|
||||
/// serialise and deserialise without loss of precision
|
||||
std::string serialize_number_to_string(double num)
|
||||
{
|
||||
// more digits and excel won't match
|
||||
constexpr int Excel_Digit_Precision = 15; //sf
|
||||
std::stringstream ss;
|
||||
ss.precision(Excel_Digit_Precision);
|
||||
ss << num;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
class number_serialiser
|
||||
{
|
||||
static constexpr int Excel_Digit_Precision = 15; //sf
|
||||
std::ostringstream ss;
|
||||
|
||||
public:
|
||||
explicit number_serialiser()
|
||||
{
|
||||
ss.precision(Excel_Digit_Precision);
|
||||
ss.imbue(std::locale("C"));
|
||||
}
|
||||
|
||||
std::string serialise(double d)
|
||||
{
|
||||
ss.str(""); // reset string buffer
|
||||
ss.clear(); // reset any error flags
|
||||
ss << d;
|
||||
return ss.str();
|
||||
}
|
||||
};
|
||||
|
||||
class number_serialiser_mk2
|
||||
{
|
||||
static constexpr int Excel_Digit_Precision = 15; //sf
|
||||
bool should_convert_comma;
|
||||
|
||||
void convert_comma(char *buf, int len)
|
||||
{
|
||||
char *buf_end = buf + len;
|
||||
char *decimal = std::find(buf, buf_end, ',');
|
||||
if (decimal != buf_end)
|
||||
{
|
||||
*decimal = '.';
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
explicit number_serialiser_mk2()
|
||||
: should_convert_comma(std::use_facet<std::numpunct<char>>(std::locale{}).decimal_point() == ',')
|
||||
{
|
||||
}
|
||||
|
||||
std::string serialise(double d)
|
||||
{
|
||||
char buf[Excel_Digit_Precision + 1]; // need space for trailing '\0'
|
||||
int len = snprintf(buf, sizeof(buf), "%.15g", d);
|
||||
if (should_convert_comma)
|
||||
{
|
||||
convert_comma(buf, len);
|
||||
}
|
||||
return std::string(buf, len);
|
||||
}
|
||||
};
|
||||
|
||||
using RandFloats = RandomFloats<true>;
|
||||
using RandFloatsComma = RandomFloats<false>;
|
||||
} // namespace
|
||||
|
||||
BENCHMARK_F(RandFloats, string_from_double_sstream)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
benchmark::DoNotOptimize(
|
||||
serialize_number_to_string(get_rand()));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_F(RandFloats, string_from_double_sstream_cached)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
number_serialiser ser;
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
benchmark::DoNotOptimize(
|
||||
ser.serialise(get_rand()));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_F(RandFloats, string_from_double_snprintf)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
char buf[16];
|
||||
int len = snprintf(buf, sizeof(buf), "%.15g", get_rand());
|
||||
|
||||
benchmark::DoNotOptimize(
|
||||
std::string(buf, len));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_F(RandFloats, string_from_double_snprintf_fixed)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
number_serialiser_mk2 ser;
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
benchmark::DoNotOptimize(
|
||||
ser.serialise(get_rand()));
|
||||
}
|
||||
}
|
||||
|
||||
// locale names are different between OS's, and std::from_chars is only complete in MSVC
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#include <charconv>
|
||||
BENCHMARK_F(RandFloats, string_from_double_std_to_chars)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
char buf[16];
|
||||
std::to_chars_result result = std::to_chars(buf, buf + std::size(buf), get_rand());
|
||||
|
||||
benchmark::DoNotOptimize(
|
||||
std::string(buf, result.ptr));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_F(RandFloatsComma, string_from_double_snprintf_fixed_comma)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
number_serialiser_mk2 ser;
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
benchmark::DoNotOptimize(
|
||||
ser.serialise(get_rand()));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,223 @@
|
|||
// A core part of the xlsx parsing routine is taking strings from the xml parser and parsing these to a double
|
||||
// this has a few requirements
|
||||
// - expect strings in the form 1234.56 (i.e. no thousands seperator, '.' used for the decimal seperator)
|
||||
// - handles atleast 15 significant figures (excel only serialises numbers up to 15sf)
|
||||
|
||||
#include <benchmark/benchmark.h>
|
||||
#include <locale>
|
||||
#include <random>
|
||||
#include <sstream>
|
||||
|
||||
namespace {
|
||||
|
||||
// setup a large quantity of random doubles as strings
|
||||
template <bool Decimal_Locale = true>
|
||||
class RandomFloatStrs : public benchmark::Fixture
|
||||
{
|
||||
static constexpr size_t Number_of_Elements = 1 << 20;
|
||||
static_assert(Number_of_Elements > 1'000'000, "ensure a decent set of random values is generated");
|
||||
|
||||
std::vector<std::string> inputs;
|
||||
|
||||
size_t index = 0;
|
||||
const char *locale_str = nullptr;
|
||||
|
||||
public:
|
||||
void SetUp(const ::benchmark::State &state)
|
||||
{
|
||||
if (Decimal_Locale)
|
||||
{
|
||||
locale_str = setlocale(LC_ALL, "C");
|
||||
}
|
||||
else
|
||||
{
|
||||
locale_str = setlocale(LC_ALL, "de-DE");
|
||||
}
|
||||
std::random_device rd; // obtain a seed for the random number engine
|
||||
std::mt19937 gen(rd());
|
||||
// doing full range is stupid (<double>::min/max()...), it just ends up generating very large numbers
|
||||
// uniform is probably not the best distribution to use here, but it will do for now
|
||||
std::uniform_real_distribution<double> dis(-1'000, 1'000);
|
||||
// generate a large quantity of doubles to deserialise
|
||||
inputs.reserve(Number_of_Elements);
|
||||
for (int i = 0; i < Number_of_Elements; ++i)
|
||||
{
|
||||
double d = dis(gen);
|
||||
char buf[16];
|
||||
snprintf(buf, 16, "%.15f", d);
|
||||
inputs.push_back(std::string(buf));
|
||||
}
|
||||
}
|
||||
|
||||
void TearDown(const ::benchmark::State &state)
|
||||
{
|
||||
// restore locale
|
||||
setlocale(LC_ALL, locale_str);
|
||||
// gbench is keeping the fixtures alive somewhere, need to clear the data after use
|
||||
inputs = std::vector<std::string>{};
|
||||
}
|
||||
|
||||
std::string &get_rand()
|
||||
{
|
||||
return inputs[++index & (Number_of_Elements - 1)];
|
||||
}
|
||||
};
|
||||
|
||||
// method used by xlsx_consumer.cpp in commit - ba01de47a7d430764c20ec9ac9600eec0eb38bcf
|
||||
// std::istringstream with the locale set to "C"
|
||||
struct number_converter
|
||||
{
|
||||
number_converter()
|
||||
{
|
||||
stream.imbue(std::locale("C"));
|
||||
}
|
||||
|
||||
double stold(const std::string &s)
|
||||
{
|
||||
stream.str(s);
|
||||
stream.clear();
|
||||
stream >> result;
|
||||
return result;
|
||||
}
|
||||
|
||||
std::istringstream stream;
|
||||
double result;
|
||||
};
|
||||
|
||||
|
||||
// to resolve the locale issue with strtod, a little preprocessing of the input is required
|
||||
struct number_converter_mk2
|
||||
{
|
||||
explicit number_converter_mk2()
|
||||
: should_convert_to_comma(std::use_facet<std::numpunct<char>>(std::locale{}).decimal_point() == ',')
|
||||
{
|
||||
}
|
||||
|
||||
double stold(std::string &s) const noexcept
|
||||
{
|
||||
assert(!s.empty());
|
||||
if (should_convert_to_comma)
|
||||
{
|
||||
auto decimal_pt = std::find(s.begin(), s.end(), '.');
|
||||
if (decimal_pt != s.end())
|
||||
{
|
||||
*decimal_pt = ',';
|
||||
}
|
||||
}
|
||||
return strtod(s.c_str(), nullptr);
|
||||
}
|
||||
|
||||
double stold(const std::string &s) const
|
||||
{
|
||||
assert(!s.empty());
|
||||
if (!should_convert_to_comma)
|
||||
{
|
||||
return strtod(s.c_str(), nullptr);
|
||||
}
|
||||
std::string copy(s);
|
||||
auto decimal_pt = std::find(copy.begin(), copy.end(), '.');
|
||||
if (decimal_pt != copy.end())
|
||||
{
|
||||
*decimal_pt = ',';
|
||||
}
|
||||
return strtod(copy.c_str(), nullptr);
|
||||
}
|
||||
|
||||
private:
|
||||
bool should_convert_to_comma = false;
|
||||
};
|
||||
|
||||
using RandFloatStrs = RandomFloatStrs<true>;
|
||||
// german locale uses ',' as the seperator
|
||||
using RandFloatCommaStrs = RandomFloatStrs<false>;
|
||||
} // namespace
|
||||
|
||||
BENCHMARK_F(RandFloatStrs, double_from_string_sstream)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
number_converter converter;
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
benchmark::DoNotOptimize(
|
||||
converter.stold(get_rand()));
|
||||
}
|
||||
}
|
||||
|
||||
// using strotod
|
||||
// https://en.cppreference.com/w/cpp/string/byte/strtof
|
||||
// this naive usage is broken in the face of locales (fails condition 1)
|
||||
#include <cstdlib>
|
||||
BENCHMARK_F(RandFloatStrs, double_from_string_strtod)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
benchmark::DoNotOptimize(
|
||||
strtod(get_rand().c_str(), nullptr));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_F(RandFloatStrs, double_from_string_strtod_fixed)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
number_converter_mk2 converter;
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
benchmark::DoNotOptimize(
|
||||
converter.stold(get_rand()));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_F(RandFloatStrs, double_from_string_strtod_fixed_const_ref)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
number_converter_mk2 converter;
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
const std::string &inp = get_rand();
|
||||
benchmark::DoNotOptimize(
|
||||
converter.stold(inp));
|
||||
}
|
||||
}
|
||||
|
||||
// locale names are different between OS's, and std::from_chars is only complete in MSVC
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#include <charconv>
|
||||
BENCHMARK_F(RandFloatStrs, double_from_string_std_from_chars)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
const std::string &input = get_rand();
|
||||
double output;
|
||||
benchmark::DoNotOptimize(
|
||||
std::from_chars(input.data(), input.data() + input.size(), output));
|
||||
}
|
||||
}
|
||||
|
||||
// not using the standard "C" locale with '.' seperator
|
||||
BENCHMARK_F(RandFloatCommaStrs, double_from_string_strtod_fixed_comma_ref)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
number_converter_mk2 converter;
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
benchmark::DoNotOptimize(
|
||||
converter.stold(get_rand()));
|
||||
}
|
||||
}
|
||||
|
||||
BENCHMARK_F(RandFloatCommaStrs, double_from_string_strtod_fixed_comma_const_ref)
|
||||
(benchmark::State &state)
|
||||
{
|
||||
number_converter_mk2 converter;
|
||||
while (state.KeepRunning())
|
||||
{
|
||||
const std::string &inp = get_rand();
|
||||
benchmark::DoNotOptimize(
|
||||
converter.stold(inp));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,58 @@
|
|||
#include <xlnt/xlnt.hpp>
|
||||
#include <chrono>
|
||||
#include <helpers/path_helper.hpp>
|
||||
|
||||
namespace {
|
||||
using milliseconds_d = std::chrono::duration<double, std::milli>;
|
||||
|
||||
void run_load_test(const xlnt::path &file, int runs = 10)
|
||||
{
|
||||
std::cout << file.string() << "\n\n";
|
||||
|
||||
xlnt::workbook wb;
|
||||
std::vector<std::chrono::steady_clock::duration> test_timings;
|
||||
|
||||
for (int i = 0; i < runs; ++i)
|
||||
{
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
wb.load(file);
|
||||
|
||||
auto end = std::chrono::steady_clock::now();
|
||||
wb.clear();
|
||||
test_timings.push_back(end - start);
|
||||
|
||||
std::cout << milliseconds_d(test_timings.back()).count() << " ms\n";
|
||||
}
|
||||
}
|
||||
|
||||
void run_save_test(const xlnt::path &file, int runs = 10)
|
||||
{
|
||||
std::cout << file.string() << "\n\n";
|
||||
|
||||
xlnt::workbook wb;
|
||||
wb.load(file);
|
||||
const xlnt::path save_path(file.filename());
|
||||
|
||||
std::vector<std::chrono::steady_clock::duration> test_timings;
|
||||
|
||||
for (int i = 0; i < runs; ++i)
|
||||
{
|
||||
auto start = std::chrono::steady_clock::now();
|
||||
|
||||
wb.save(save_path);
|
||||
|
||||
auto end = std::chrono::steady_clock::now();
|
||||
test_timings.push_back(end - start);
|
||||
std::cout << milliseconds_d(test_timings.back()).count() << " ms\n";
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
{
|
||||
run_load_test(path_helper::benchmark_file("large.xlsx"));
|
||||
run_load_test(path_helper::benchmark_file("very_large.xlsx"));
|
||||
|
||||
run_save_test(path_helper::benchmark_file("large.xlsx"));
|
||||
run_save_test(path_helper::benchmark_file("very_large.xlsx"));
|
||||
}
|
|
@ -1,108 +1,250 @@
|
|||
// Copyright (c) 2017-2018 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <iterator>
|
||||
#include <random>
|
||||
|
||||
#include <helpers/timing.hpp>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
std::size_t current_time()
|
||||
{
|
||||
return std::chrono::duration<double, std::milli>(std::chrono::system_clock::now().time_since_epoch()).count();
|
||||
}
|
||||
namespace {
|
||||
|
||||
std::size_t random_index(std::size_t max)
|
||||
{
|
||||
static std::random_device rd;
|
||||
static std::mt19937 gen(rd());
|
||||
|
||||
std::uniform_int_distribution<> dis(0, max - 1);
|
||||
std::uniform_int_distribution<> dis(0, static_cast<int>(max - 1));
|
||||
|
||||
return dis(gen);
|
||||
}
|
||||
|
||||
std::vector<xlnt::style> generate_all_styles(xlnt::workbook &wb)
|
||||
void generate_all_formats(xlnt::workbook &wb, std::vector<xlnt::format>& formats)
|
||||
{
|
||||
std::vector<xlnt::style> styles;
|
||||
const auto vertical_alignments = std::vector<xlnt::vertical_alignment>
|
||||
{
|
||||
xlnt::vertical_alignment::center,
|
||||
xlnt::vertical_alignment::justify,
|
||||
xlnt::vertical_alignment::top,
|
||||
xlnt::vertical_alignment::bottom
|
||||
};
|
||||
|
||||
std::vector<xlnt::vertical_alignment> vertical_alignments = {xlnt::vertical_alignment::center, xlnt::vertical_alignment::justify, xlnt::vertical_alignment::top, xlnt::vertical_alignment::bottom};
|
||||
std::vector<xlnt::horizontal_alignment> horizontal_alignments = {xlnt::horizontal_alignment::center, xlnt::horizontal_alignment::center_continuous, xlnt::horizontal_alignment::general, xlnt::horizontal_alignment::justify, xlnt::horizontal_alignment::left, xlnt::horizontal_alignment::right};
|
||||
std::vector<std::string> font_names = {"Calibri", "Tahoma", "Arial", "Times New Roman"};
|
||||
std::vector<int> font_sizes = {11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35};
|
||||
std::vector<bool> bold_options = {true, false};
|
||||
std::vector<xlnt::font::underline_style> underline_options = {xlnt::font::underline_style::single, xlnt::font::underline_style::none};
|
||||
std::vector<bool> italic_options = {true, false};
|
||||
std::size_t index = 0;
|
||||
|
||||
for(auto vertical_alignment : vertical_alignments)
|
||||
{
|
||||
for(auto horizontal_alignment : horizontal_alignments)
|
||||
{
|
||||
for(auto name : font_names)
|
||||
{
|
||||
for(auto size : font_sizes)
|
||||
{
|
||||
for(auto bold : bold_options)
|
||||
{
|
||||
for(auto underline : underline_options)
|
||||
{
|
||||
for(auto italic : italic_options)
|
||||
{
|
||||
auto s = wb.create_style(std::to_string(index++));
|
||||
const auto horizontal_alignments = std::vector<xlnt::horizontal_alignment>
|
||||
{
|
||||
xlnt::horizontal_alignment::center,
|
||||
xlnt::horizontal_alignment::center_continuous,
|
||||
xlnt::horizontal_alignment::general,
|
||||
xlnt::horizontal_alignment::justify,
|
||||
xlnt::horizontal_alignment::left,
|
||||
xlnt::horizontal_alignment::right
|
||||
};
|
||||
|
||||
xlnt::font f;
|
||||
f.name(name);
|
||||
f.size(size);
|
||||
f.italic(italic);
|
||||
f.underline(underline);
|
||||
f.bold(bold);
|
||||
s.font(f);
|
||||
const auto font_names = std::vector<std::string>
|
||||
{
|
||||
"Calibri",
|
||||
"Tahoma",
|
||||
"Arial",
|
||||
"Times New Roman"
|
||||
};
|
||||
|
||||
xlnt::alignment a;
|
||||
a.vertical(vertical_alignment);
|
||||
a.horizontal(horizontal_alignment);
|
||||
s.alignment(a);
|
||||
const auto font_sizes = std::vector<double>
|
||||
{
|
||||
11.,
|
||||
13.,
|
||||
15.,
|
||||
17.,
|
||||
19.,
|
||||
21.,
|
||||
23.,
|
||||
25.,
|
||||
27.,
|
||||
29.,
|
||||
31.,
|
||||
33.,
|
||||
35.
|
||||
};
|
||||
|
||||
styles.push_back(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const auto underline_options = std::vector<xlnt::font::underline_style>
|
||||
{
|
||||
xlnt::font::underline_style::single,
|
||||
xlnt::font::underline_style::none
|
||||
};
|
||||
|
||||
return styles;
|
||||
for (auto vertical_alignment : vertical_alignments)
|
||||
{
|
||||
for (auto horizontal_alignment : horizontal_alignments)
|
||||
{
|
||||
for (auto name : font_names)
|
||||
{
|
||||
for (auto size : font_sizes)
|
||||
{
|
||||
for (auto bold : { true, false })
|
||||
{
|
||||
for (auto underline : underline_options)
|
||||
{
|
||||
for (auto italic : { true, false })
|
||||
{
|
||||
auto fmt = wb.create_format();
|
||||
|
||||
xlnt::font f;
|
||||
f.name(name);
|
||||
f.size(size);
|
||||
f.italic(italic);
|
||||
f.underline(underline);
|
||||
f.bold(bold);
|
||||
fmt.font(f);
|
||||
|
||||
xlnt::alignment a;
|
||||
a.vertical(vertical_alignment);
|
||||
a.horizontal(horizontal_alignment);
|
||||
fmt.alignment(a);
|
||||
|
||||
formats.push_back(fmt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xlnt::workbook non_optimized_workbook(int n)
|
||||
|
||||
xlnt::workbook non_optimized_workbook_formats(int rows_number, int columns_number)
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto styles = generate_all_styles(wb);
|
||||
using xlnt::benchmarks::current_time;
|
||||
|
||||
for(int idx = 1; idx < n; idx++)
|
||||
{
|
||||
auto worksheet = wb[random_index(wb.sheet_count())];
|
||||
auto cell = worksheet.cell(1, (xlnt::row_t)idx);
|
||||
cell.value(0);
|
||||
cell.style(styles.at(random_index(styles.size())));
|
||||
}
|
||||
xlnt::workbook wb;
|
||||
std::vector<xlnt::format> formats;
|
||||
auto start = current_time();
|
||||
|
||||
return wb;
|
||||
generate_all_formats(wb, formats);
|
||||
|
||||
auto elapsed = current_time() - start;
|
||||
|
||||
std::cout << "elapsed " << elapsed / 1000.0 << ". generate_all_formats. number of unique formats " << formats.size() << std::endl;
|
||||
|
||||
start = current_time();
|
||||
auto worksheet = wb[random_index(wb.sheet_count())];
|
||||
auto cells_proceeded = 0;
|
||||
for (int row_idx = 1; row_idx <= rows_number; row_idx++)
|
||||
{
|
||||
for (int col_idx = 1; col_idx <= columns_number; col_idx++)
|
||||
{
|
||||
auto cell = worksheet.cell(xlnt::cell_reference((xlnt::column_t)col_idx, (xlnt::row_t)row_idx));
|
||||
std::ostringstream string_stm;
|
||||
string_stm << "Col: " << col_idx << "Row: " << row_idx;
|
||||
cell.value(string_stm.str());
|
||||
cell.format(formats.at(random_index(formats.size())));
|
||||
cells_proceeded++;
|
||||
}
|
||||
}
|
||||
|
||||
elapsed = current_time() - start;
|
||||
|
||||
std::cout << "elapsed " << elapsed / 1000.0 << ". set values and formats for cells. cells proceeded " << cells_proceeded << std::endl;
|
||||
|
||||
return wb;
|
||||
}
|
||||
|
||||
void to_profile(xlnt::workbook &wb, const std::string &f, int n)
|
||||
void to_save_profile(xlnt::workbook &wb, const std::string &f)
|
||||
{
|
||||
using xlnt::benchmarks::current_time;
|
||||
|
||||
auto start = current_time();
|
||||
wb.save(f);
|
||||
auto elapsed = current_time() - start;
|
||||
std::cout << "took " << elapsed / 1000.0 << "s for " << n << " styles" << std::endl;
|
||||
|
||||
std::cout << "elapsed " << elapsed / 1000.0 << ". save workbook." << std::endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
void to_load_profile(xlnt::workbook &wb, const std::string &f)
|
||||
{
|
||||
int n = 10000;
|
||||
auto wb = non_optimized_workbook(n);
|
||||
std::string f = "temp.xlsx";
|
||||
to_profile(wb, f, n);
|
||||
using xlnt::benchmarks::current_time;
|
||||
|
||||
auto start = current_time();
|
||||
wb.load(f);
|
||||
auto elapsed = current_time() - start;
|
||||
|
||||
std::cout << "elapsed " << elapsed / 1000.0 << ". load workbook." << std::endl;
|
||||
}
|
||||
|
||||
void read_formats_profile(xlnt::workbook &wb, int rows_number, int columns_number)
|
||||
{
|
||||
using xlnt::benchmarks::current_time;
|
||||
|
||||
std::vector<std::string> values;
|
||||
std::vector<xlnt::format> formats;
|
||||
auto start = current_time();
|
||||
auto worksheet = wb[random_index(wb.sheet_count())];
|
||||
for (int row_idx = 1; row_idx <= rows_number; row_idx++)
|
||||
{
|
||||
for (int col_idx = 1; col_idx <= columns_number; col_idx++)
|
||||
{
|
||||
auto cell = worksheet.cell(xlnt::cell_reference((xlnt::column_t)col_idx, (xlnt::row_t)row_idx));
|
||||
values.push_back(cell.value<std::string>());
|
||||
formats.push_back(cell.format());
|
||||
}
|
||||
}
|
||||
|
||||
auto elapsed = current_time() - start;
|
||||
|
||||
std::cout << "elapsed " << elapsed / 1000.0 << ". read values and formats for cells. values count " << values.size()
|
||||
<< ". formats count " << formats.size() << std::endl;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
int rows_number = 1000;
|
||||
int columns_number = 10;
|
||||
|
||||
try
|
||||
{
|
||||
if (argc > 1)
|
||||
rows_number = std::stoi(argv[1]);
|
||||
|
||||
if (argc > 2)
|
||||
columns_number = std::stoi(argv[2]);
|
||||
|
||||
std::cout << "started. number of rows " << rows_number << ", number of columns " << columns_number << std::endl;
|
||||
auto wb = non_optimized_workbook_formats(rows_number, columns_number);
|
||||
auto f = "temp-formats.xlsx";
|
||||
to_save_profile(wb, f);
|
||||
|
||||
xlnt::workbook load_formats_wb;
|
||||
to_load_profile(load_formats_wb, f);
|
||||
read_formats_profile(load_formats_wb, rows_number, columns_number);
|
||||
}
|
||||
catch(std::exception& ex)
|
||||
{
|
||||
std::cout << "failed. " << ex.what() << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,33 @@
|
|||
// Copyright (c) 2017-2018 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
|
||||
#include <helpers/timing.hpp>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
std::size_t current_time()
|
||||
{
|
||||
return std::chrono::duration<double, std::milli>(std::chrono::system_clock::now().time_since_epoch()).count();
|
||||
}
|
||||
namespace {
|
||||
|
||||
// Create a worksheet with variable width rows. Because data must be
|
||||
// serialised row by row it is often the width of the rows which is most
|
||||
|
@ -15,61 +37,54 @@ void writer(int cols, int rows)
|
|||
xlnt::workbook wb;
|
||||
auto ws = wb.create_sheet();
|
||||
|
||||
std::vector<int> row;
|
||||
|
||||
for(int i = 0; i < cols; i++)
|
||||
{
|
||||
row.push_back(i);
|
||||
}
|
||||
|
||||
for(int index = 0; index < rows; index++)
|
||||
{
|
||||
if ((index + 1) % (rows / 10) == 0)
|
||||
if (rows >= 10 && (index + 1) % (rows / 10) == 0)
|
||||
{
|
||||
std::string progress = std::string((index + 1) / (1 + rows / 10), '.');
|
||||
std::cout << "\r" << progress;
|
||||
std::cout.flush();
|
||||
}
|
||||
|
||||
ws.append(row);
|
||||
for (int i = 0; i < cols; i++)
|
||||
{
|
||||
ws.cell(xlnt::cell_reference(i + 1, index + 1)).value(i);
|
||||
}
|
||||
}
|
||||
std::cout << '\n';
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
auto filename = "data/benchmark.xlsx";
|
||||
auto filename = "benchmark.xlsx";
|
||||
wb.save(filename);
|
||||
}
|
||||
|
||||
// Create a timeit call to a function and pass in keyword arguments.
|
||||
// The function is called twice, once using the standard workbook, then with the optimised one.
|
||||
// Time from the best of three is taken.
|
||||
int timer(std::function<void(int, int)> fn, int cols, int rows)
|
||||
void timer(std::function<void(int, int)> fn, int cols, int rows)
|
||||
{
|
||||
const auto repeat = std::size_t(3);
|
||||
auto time = std::numeric_limits<std::size_t>::max();
|
||||
|
||||
std::chrono::duration<double, std::milli> time{};
|
||||
std::cout << cols << " cols " << rows << " rows" << std::endl;
|
||||
fn(rows, cols); // 1 cold run
|
||||
|
||||
for(int i = 0; i < repeat; i++)
|
||||
{
|
||||
auto start = current_time();
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
fn(cols, rows);
|
||||
time = std::min(current_time() - start, time);
|
||||
time += std::chrono::high_resolution_clock::now() - start;
|
||||
}
|
||||
|
||||
std::cout << time / 1000.0 << std::endl;
|
||||
|
||||
return time;
|
||||
std::cout << time.count() / repeat << " ms per iteration" << '\n' << '\n';
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int main()
|
||||
{
|
||||
timer(&writer, 10000, 1);
|
||||
timer(&writer, 1000, 10);
|
||||
timer(&writer, 100, 100);
|
||||
timer(&writer, 1000, 100);
|
||||
timer(&writer, 4000, 100);
|
||||
timer(&writer, 8192, 100);
|
||||
timer(&writer, 10, 10000);
|
||||
timer(&writer, 4000, 1000);
|
||||
timer(&writer, 10, 1000);
|
||||
timer(&writer, 1, 10000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"plugins": ["build"],
|
||||
"pluginsConfig": {
|
||||
"build": {
|
||||
"template": "docs/template.ejs",
|
||||
"format": "man",
|
||||
"output": "docs/xlnt.3"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# - Find ARROW (arrow/api.h, libarrow.a, libarrow.so)
|
||||
# This module defines
|
||||
# ARROW_INCLUDE_DIR, directory containing headers
|
||||
# ARROW_LIBS, directory containing arrow libraries
|
||||
# ARROW_STATIC_LIB, path to libarrow.a
|
||||
# ARROW_SHARED_LIB, path to libarrow's shared library
|
||||
# ARROW_SHARED_IMP_LIB, path to libarrow's import library (MSVC only)
|
||||
# ARROW_FOUND, whether arrow has been found
|
||||
|
||||
include(FindPkgConfig)
|
||||
|
||||
if ("$ENV{ARROW_HOME}" STREQUAL "")
|
||||
pkg_check_modules(ARROW arrow)
|
||||
if (ARROW_FOUND)
|
||||
pkg_get_variable(ARROW_ABI_VERSION arrow abi_version)
|
||||
message(STATUS "Arrow ABI version: ${ARROW_ABI_VERSION}")
|
||||
pkg_get_variable(ARROW_SO_VERSION arrow so_version)
|
||||
message(STATUS "Arrow SO version: ${ARROW_SO_VERSION}")
|
||||
set(ARROW_INCLUDE_DIR ${ARROW_INCLUDE_DIRS})
|
||||
set(ARROW_LIBS ${ARROW_LIBRARY_DIRS})
|
||||
set(ARROW_SEARCH_LIB_PATH ${ARROW_LIBRARY_DIRS})
|
||||
endif()
|
||||
else()
|
||||
set(ARROW_HOME "$ENV{ARROW_HOME}")
|
||||
|
||||
set(ARROW_SEARCH_HEADER_PATHS
|
||||
${ARROW_HOME}/include
|
||||
)
|
||||
|
||||
set(ARROW_SEARCH_LIB_PATH
|
||||
${ARROW_HOME}/lib
|
||||
)
|
||||
|
||||
find_path(ARROW_INCLUDE_DIR arrow/array.h PATHS
|
||||
${ARROW_SEARCH_HEADER_PATHS}
|
||||
# make sure we don't accidentally pick up a different version
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
endif()
|
||||
|
||||
find_library(ARROW_LIB_PATH NAMES arrow
|
||||
PATHS
|
||||
${ARROW_SEARCH_LIB_PATH}
|
||||
NO_DEFAULT_PATH)
|
||||
get_filename_component(ARROW_LIBS ${ARROW_LIB_PATH} DIRECTORY)
|
||||
|
||||
find_library(ARROW_PYTHON_LIB_PATH NAMES arrow_python
|
||||
PATHS
|
||||
${ARROW_SEARCH_LIB_PATH}
|
||||
NO_DEFAULT_PATH)
|
||||
get_filename_component(ARROW_PYTHON_LIBS ${ARROW_PYTHON_LIB_PATH} DIRECTORY)
|
||||
|
||||
if (MSVC)
|
||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
|
||||
|
||||
if (MSVC AND NOT ARROW_MSVC_STATIC_LIB_SUFFIX)
|
||||
set(ARROW_MSVC_STATIC_LIB_SUFFIX "_static")
|
||||
endif()
|
||||
|
||||
find_library(ARROW_SHARED_LIBRARIES NAMES arrow
|
||||
PATHS ${ARROW_HOME} NO_DEFAULT_PATH
|
||||
PATH_SUFFIXES "bin" )
|
||||
|
||||
find_library(ARROW_PYTHON_SHARED_LIBRARIES NAMES arrow_python
|
||||
PATHS ${ARROW_HOME} NO_DEFAULT_PATH
|
||||
PATH_SUFFIXES "bin" )
|
||||
get_filename_component(ARROW_SHARED_LIBS ${ARROW_SHARED_LIBRARIES} PATH )
|
||||
get_filename_component(ARROW_PYTHON_SHARED_LIBS ${ARROW_PYTHON_SHARED_LIBRARIES} PATH )
|
||||
endif ()
|
||||
|
||||
if (ARROW_INCLUDE_DIR AND ARROW_LIBS)
|
||||
set(ARROW_FOUND TRUE)
|
||||
set(ARROW_LIB_NAME arrow)
|
||||
set(ARROW_PYTHON_LIB_NAME arrow_python)
|
||||
if (MSVC)
|
||||
set(ARROW_STATIC_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}${ARROW_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIBS}/${ARROW_PYTHON_LIB_NAME}${ARROW_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
set(ARROW_SHARED_LIB ${ARROW_SHARED_LIBS}/${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(ARROW_PYTHON_SHARED_LIB ${ARROW_PYTHON_SHARED_LIBS}/${ARROW_PYTHON_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(ARROW_SHARED_IMP_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}.lib)
|
||||
set(ARROW_PYTHON_SHARED_IMP_LIB ${ARROW_PYTHON_LIBS}/${ARROW_PYTHON_LIB_NAME}.lib)
|
||||
else()
|
||||
set(ARROW_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/lib${ARROW_LIB_NAME}.a)
|
||||
set(ARROW_PYTHON_STATIC_LIB ${ARROW_PYTHON_LIB_PATH}/lib${ARROW_PYTHON_LIB_NAME}.a)
|
||||
|
||||
set(ARROW_SHARED_LIB ${ARROW_LIBS}/lib${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(ARROW_PYTHON_SHARED_LIB ${ARROW_LIBS}/lib${ARROW_PYTHON_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ARROW_FOUND)
|
||||
if (NOT Arrow_FIND_QUIETLY)
|
||||
message(STATUS "Found the Arrow core library: ${ARROW_LIB_PATH}")
|
||||
message(STATUS "Found the Arrow Python library: ${ARROW_PYTHON_LIB_PATH}")
|
||||
endif ()
|
||||
else ()
|
||||
if (NOT Arrow_FIND_QUIETLY)
|
||||
set(ARROW_ERR_MSG "Could not find the Arrow library. Looked for headers")
|
||||
set(ARROW_ERR_MSG "${ARROW_ERR_MSG} in ${ARROW_SEARCH_HEADER_PATHS}, and for libs")
|
||||
set(ARROW_ERR_MSG "${ARROW_ERR_MSG} in ${ARROW_SEARCH_LIB_PATH}")
|
||||
if (Arrow_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "${ARROW_ERR_MSG}")
|
||||
else (Arrow_FIND_REQUIRED)
|
||||
message(STATUS "${ARROW_ERR_MSG}")
|
||||
endif (Arrow_FIND_REQUIRED)
|
||||
endif ()
|
||||
set(ARROW_FOUND FALSE)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(
|
||||
ARROW_INCLUDE_DIR
|
||||
ARROW_STATIC_LIB
|
||||
ARROW_SHARED_LIB
|
||||
ARROW_PYTHON_STATIC_LIB
|
||||
ARROW_PYTHON_SHARED_LIB
|
||||
)
|
|
@ -0,0 +1,13 @@
|
|||
set(XLNT_VERSION "@xlnt_VERSION@")
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
get_filename_component(XLNT_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
|
||||
set_and_check(XLNT_INCLUDE_DIR "@XLNT_INCLUDE_INSTALL_DIR@")
|
||||
|
||||
check_required_components(xlnt)
|
||||
|
||||
if(NOT TARGET xlnt::xlnt)
|
||||
include("${XLNT_CMAKE_DIR}/XlntTargets.cmake")
|
||||
endif()
|
|
@ -1,24 +0,0 @@
|
|||
set(LIBRARY_NAME xlnt)
|
||||
set(LIBRARY_VERSION 0.9.1)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
|
||||
# Global library directories
|
||||
set(LIBRARY_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../include)
|
||||
set(LIBRARY_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../source)
|
||||
set(THIRD_PARTY_DIR ${CMAKE_CURRENT_LIST_DIR}/../third-party)
|
||||
|
||||
# Put all output files in the same directory
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/bin)
|
||||
endforeach()
|
|
@ -0,0 +1,634 @@
|
|||
#
|
||||
# ucm.cmake - useful cmake macros
|
||||
#
|
||||
# Copyright (c) 2016 Viktor Kirilov
|
||||
#
|
||||
# Distributed under the MIT Software License
|
||||
# See accompanying file LICENSE.txt or copy at
|
||||
# https://opensource.org/licenses/MIT
|
||||
#
|
||||
# The documentation can be found at the library's page:
|
||||
# https://github.com/onqtam/ucm
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
include(CMakeParseArguments)
|
||||
|
||||
# optionally include cotire - the git submodule might not be inited (or the user might have already included it)
|
||||
if(NOT COMMAND cotire)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cotire/CMake/cotire.cmake OPTIONAL)
|
||||
endif()
|
||||
|
||||
if(COMMAND cotire AND "1.7.9" VERSION_LESS "${COTIRE_CMAKE_MODULE_VERSION}")
|
||||
set(ucm_with_cotire 1)
|
||||
else()
|
||||
set(ucm_with_cotire 0)
|
||||
endif()
|
||||
|
||||
option(UCM_UNITY_BUILD "Enable unity build for targets registered with the ucm_add_target() macro" OFF)
|
||||
option(UCM_NO_COTIRE_FOLDER "Do not use a cotire folder in the solution explorer for all unity and cotire related targets" ON)
|
||||
|
||||
# ucm_add_flags
|
||||
# Adds compiler flags to CMAKE_<LANG>_FLAGS or to a specific config
|
||||
macro(ucm_add_flags)
|
||||
cmake_parse_arguments(ARG "C;CXX;CLEAR_OLD" "" "CONFIG" ${ARGN})
|
||||
|
||||
if(NOT ARG_CONFIG)
|
||||
set(ARG_CONFIG " ")
|
||||
endif()
|
||||
|
||||
foreach(CONFIG ${ARG_CONFIG})
|
||||
# determine to which flags to add
|
||||
if(NOT ${CONFIG} STREQUAL " ")
|
||||
string(TOUPPER ${CONFIG} CONFIG)
|
||||
set(CXX_FLAGS CMAKE_CXX_FLAGS_${CONFIG})
|
||||
set(C_FLAGS CMAKE_C_FLAGS_${CONFIG})
|
||||
else()
|
||||
set(CXX_FLAGS CMAKE_CXX_FLAGS)
|
||||
set(C_FLAGS CMAKE_C_FLAGS)
|
||||
endif()
|
||||
|
||||
# clear the old flags
|
||||
if(${ARG_CLEAR_OLD})
|
||||
if("${ARG_CXX}" OR NOT "${ARG_C}")
|
||||
set(${CXX_FLAGS} "")
|
||||
endif()
|
||||
if("${ARG_C}" OR NOT "${ARG_CXX}")
|
||||
set(${C_FLAGS} "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# add all the passed flags
|
||||
foreach(flag ${ARG_UNPARSED_ARGUMENTS})
|
||||
if("${ARG_CXX}" OR NOT "${ARG_C}")
|
||||
set(${CXX_FLAGS} "${${CXX_FLAGS}} ${flag}")
|
||||
endif()
|
||||
if("${ARG_C}" OR NOT "${ARG_CXX}")
|
||||
set(${C_FLAGS} "${${C_FLAGS}} ${flag}")
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
endmacro()
|
||||
|
||||
# ucm_set_flags
|
||||
# Sets the CMAKE_<LANG>_FLAGS compiler flags or for a specific config
|
||||
macro(ucm_set_flags)
|
||||
ucm_add_flags(CLEAR_OLD ${ARGN})
|
||||
endmacro()
|
||||
|
||||
# ucm_add_linker_flags
|
||||
# Adds linker flags to CMAKE_<TYPE>_LINKER_FLAGS or to a specific config
|
||||
macro(ucm_add_linker_flags)
|
||||
cmake_parse_arguments(ARG "CLEAR_OLD;EXE;MODULE;SHARED;STATIC" "" "CONFIG" ${ARGN})
|
||||
|
||||
if(NOT ARG_CONFIG)
|
||||
set(ARG_CONFIG " ")
|
||||
endif()
|
||||
|
||||
foreach(CONFIG ${ARG_CONFIG})
|
||||
string(TOUPPER "${CONFIG}" CONFIG)
|
||||
|
||||
if(NOT ${ARG_EXE} AND NOT ${ARG_MODULE} AND NOT ${ARG_SHARED} AND NOT ${ARG_STATIC})
|
||||
set(ARG_EXE 1)
|
||||
set(ARG_MODULE 1)
|
||||
set(ARG_SHARED 1)
|
||||
set(ARG_STATIC 1)
|
||||
endif()
|
||||
|
||||
set(flags_configs "")
|
||||
if(${ARG_EXE})
|
||||
if(NOT "${CONFIG}" STREQUAL " ")
|
||||
list(APPEND flags_configs CMAKE_EXE_LINKER_FLAGS_${CONFIG})
|
||||
else()
|
||||
list(APPEND flags_configs CMAKE_EXE_LINKER_FLAGS)
|
||||
endif()
|
||||
endif()
|
||||
if(${ARG_MODULE})
|
||||
if(NOT "${CONFIG}" STREQUAL " ")
|
||||
list(APPEND flags_configs CMAKE_MODULE_LINKER_FLAGS_${CONFIG})
|
||||
else()
|
||||
list(APPEND flags_configs CMAKE_MODULE_LINKER_FLAGS)
|
||||
endif()
|
||||
endif()
|
||||
if(${ARG_SHARED})
|
||||
if(NOT "${CONFIG}" STREQUAL " ")
|
||||
list(APPEND flags_configs CMAKE_SHARED_LINKER_FLAGS_${CONFIG})
|
||||
else()
|
||||
list(APPEND flags_configs CMAKE_SHARED_LINKER_FLAGS)
|
||||
endif()
|
||||
endif()
|
||||
if(${ARG_STATIC})
|
||||
if(NOT "${CONFIG}" STREQUAL " ")
|
||||
list(APPEND flags_configs CMAKE_STATIC_LINKER_FLAGS_${CONFIG})
|
||||
else()
|
||||
list(APPEND flags_configs CMAKE_STATIC_LINKER_FLAGS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# clear the old flags
|
||||
if(${ARG_CLEAR_OLD})
|
||||
foreach(flags ${flags_configs})
|
||||
set(${flags} "")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# add all the passed flags
|
||||
foreach(flag ${ARG_UNPARSED_ARGUMENTS})
|
||||
foreach(flags ${flags_configs})
|
||||
set(${flags} "${${flags}} ${flag}")
|
||||
endforeach()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# ucm_set_linker_flags
|
||||
# Sets the CMAKE_<TYPE>_LINKER_FLAGS linker flags or for a specific config
|
||||
macro(ucm_set_linker_flags)
|
||||
ucm_add_linker_flags(CLEAR_OLD ${ARGN})
|
||||
endmacro()
|
||||
|
||||
# ucm_gather_flags
|
||||
# Gathers all lists of flags for printing or manipulation
|
||||
macro(ucm_gather_flags with_linker result)
|
||||
set(${result} "")
|
||||
# add the main flags without a config
|
||||
list(APPEND ${result} CMAKE_C_FLAGS)
|
||||
list(APPEND ${result} CMAKE_CXX_FLAGS)
|
||||
if(${with_linker})
|
||||
list(APPEND ${result} CMAKE_EXE_LINKER_FLAGS)
|
||||
list(APPEND ${result} CMAKE_MODULE_LINKER_FLAGS)
|
||||
list(APPEND ${result} CMAKE_SHARED_LINKER_FLAGS)
|
||||
list(APPEND ${result} CMAKE_STATIC_LINKER_FLAGS)
|
||||
endif()
|
||||
|
||||
if("${CMAKE_CONFIGURATION_TYPES}" STREQUAL "" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
# handle single config generators - like makefiles/ninja - when CMAKE_BUILD_TYPE is set
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} config)
|
||||
list(APPEND ${result} CMAKE_C_FLAGS_${config})
|
||||
list(APPEND ${result} CMAKE_CXX_FLAGS_${config})
|
||||
if(${with_linker})
|
||||
list(APPEND ${result} CMAKE_EXE_LINKER_FLAGS_${config})
|
||||
list(APPEND ${result} CMAKE_MODULE_LINKER_FLAGS_${config})
|
||||
list(APPEND ${result} CMAKE_SHARED_LINKER_FLAGS_${config})
|
||||
list(APPEND ${result} CMAKE_STATIC_LINKER_FLAGS_${config})
|
||||
endif()
|
||||
else()
|
||||
# handle multi config generators (like msvc, xcode)
|
||||
foreach(config ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(TOUPPER ${config} config)
|
||||
list(APPEND ${result} CMAKE_C_FLAGS_${config})
|
||||
list(APPEND ${result} CMAKE_CXX_FLAGS_${config})
|
||||
if(${with_linker})
|
||||
list(APPEND ${result} CMAKE_EXE_LINKER_FLAGS_${config})
|
||||
list(APPEND ${result} CMAKE_MODULE_LINKER_FLAGS_${config})
|
||||
list(APPEND ${result} CMAKE_SHARED_LINKER_FLAGS_${config})
|
||||
list(APPEND ${result} CMAKE_STATIC_LINKER_FLAGS_${config})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# ucm_set_runtime
|
||||
# Sets the runtime (static/dynamic) for msvc/gcc
|
||||
macro(ucm_set_runtime)
|
||||
cmake_parse_arguments(ARG "STATIC;DYNAMIC" "" "" ${ARGN})
|
||||
|
||||
if(ARG_UNPARSED_ARGUMENTS)
|
||||
message(FATAL_ERROR "unrecognized arguments: ${ARG_UNPARSED_ARGUMENTS}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" STREQUAL "")
|
||||
message(AUTHOR_WARNING "ucm_set_runtime() does not support clang yet!")
|
||||
endif()
|
||||
|
||||
ucm_gather_flags(0 flags_configs)
|
||||
|
||||
# add/replace the flags
|
||||
# note that if the user has messed with the flags directly this function might fail
|
||||
# - for example if with MSVC and the user has removed the flags - here we just switch/replace them
|
||||
if("${ARG_STATIC}")
|
||||
foreach(flags ${flags_configs})
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if(NOT ${flags} MATCHES "-static-libstdc\\+\\+")
|
||||
set(${flags} "${${flags}} -static-libstdc++")
|
||||
endif()
|
||||
if(NOT ${flags} MATCHES "-static-libgcc")
|
||||
set(${flags} "${${flags}} -static-libgcc")
|
||||
endif()
|
||||
elseif(MSVC)
|
||||
if(${flags} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${flags} "${${flags}}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
elseif("${ARG_DYNAMIC}")
|
||||
foreach(flags ${flags_configs})
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
if(${flags} MATCHES "-static-libstdc\\+\\+")
|
||||
string(REGEX REPLACE "-static-libstdc\\+\\+" "" ${flags} "${${flags}}")
|
||||
endif()
|
||||
if(${flags} MATCHES "-static-libgcc")
|
||||
string(REGEX REPLACE "-static-libgcc" "" ${flags} "${${flags}}")
|
||||
endif()
|
||||
elseif(MSVC)
|
||||
if(${flags} MATCHES "/MT")
|
||||
string(REGEX REPLACE "/MT" "/MD" ${flags} "${${flags}}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# ucm_print_flags
|
||||
# Prints all compiler flags for all configurations
|
||||
macro(ucm_print_flags)
|
||||
ucm_gather_flags(1 flags_configs)
|
||||
message("")
|
||||
foreach(flags ${flags_configs})
|
||||
message("${flags}: ${${flags}}")
|
||||
endforeach()
|
||||
message("")
|
||||
endmacro()
|
||||
|
||||
# ucm_count_sources
|
||||
# Counts the number of source files
|
||||
macro(ucm_count_sources)
|
||||
cmake_parse_arguments(ARG "" "RESULT" "" ${ARGN})
|
||||
if(${ARG_RESULT} STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass RESULT and a variable name to ucm_count_sources()")
|
||||
endif()
|
||||
|
||||
set(result 0)
|
||||
foreach(SOURCE_FILE ${ARG_UNPARSED_ARGUMENTS})
|
||||
if("${SOURCE_FILE}" MATCHES \\.\(c|C|cc|cp|cpp|CPP|c\\+\\+|cxx|i|ii\)$)
|
||||
math(EXPR result "${result} + 1")
|
||||
endif()
|
||||
endforeach()
|
||||
set(${ARG_RESULT} ${result})
|
||||
endmacro()
|
||||
|
||||
# ucm_include_file_in_sources
|
||||
# Includes the file to the source with compiler flags
|
||||
macro(ucm_include_file_in_sources)
|
||||
cmake_parse_arguments(ARG "" "HEADER" "" ${ARGN})
|
||||
if(${ARG_HEADER} STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass HEADER and a header file to ucm_include_file_in_sources()")
|
||||
endif()
|
||||
|
||||
foreach(src ${ARG_UNPARSED_ARGUMENTS})
|
||||
if(${src} MATCHES \\.\(c|C|cc|cp|cpp|CPP|c\\+\\+|cxx\)$)
|
||||
# get old flags
|
||||
get_source_file_property(old_compile_flags ${src} COMPILE_FLAGS)
|
||||
if(old_compile_flags STREQUAL "NOTFOUND")
|
||||
set(old_compile_flags "")
|
||||
endif()
|
||||
|
||||
# update flags
|
||||
if(MSVC)
|
||||
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS
|
||||
"${old_compile_flags} /FI\"${CMAKE_CURRENT_SOURCE_DIR}/${ARG_HEADER}\"")
|
||||
else()
|
||||
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS
|
||||
"${old_compile_flags} -include \"${CMAKE_CURRENT_SOURCE_DIR}/${ARG_HEADER}\"")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# ucm_dir_list
|
||||
# Returns a list of subdirectories for a given directory
|
||||
macro(ucm_dir_list thedir result)
|
||||
file(GLOB sub-dir "${thedir}/*")
|
||||
set(list_of_dirs "")
|
||||
foreach(dir ${sub-dir})
|
||||
if(IS_DIRECTORY ${dir})
|
||||
get_filename_component(DIRNAME ${dir} NAME)
|
||||
LIST(APPEND list_of_dirs ${DIRNAME})
|
||||
endif()
|
||||
endforeach()
|
||||
set(${result} ${list_of_dirs})
|
||||
endmacro()
|
||||
|
||||
# ucm_trim_front_words
|
||||
# Trims X times the front word from a string separated with "/" and removes
|
||||
# the front "/" characters after that (used for filters for visual studio)
|
||||
macro(ucm_trim_front_words source out num_filter_trims)
|
||||
set(result "${source}")
|
||||
set(counter 0)
|
||||
while(${counter} LESS ${num_filter_trims})
|
||||
MATH(EXPR counter "${counter} + 1")
|
||||
# removes everything at the front up to a "/" character
|
||||
string(REGEX REPLACE "^([^/]+)" "" result "${result}")
|
||||
# removes all consecutive "/" characters from the front
|
||||
string(REGEX REPLACE "^(/+)" "" result "${result}")
|
||||
endwhile()
|
||||
set(${out} ${result})
|
||||
endmacro()
|
||||
|
||||
# ucm_remove_files
|
||||
# Removes source files from a list of sources (path is the relative path for it to be found)
|
||||
macro(ucm_remove_files)
|
||||
cmake_parse_arguments(ARG "" "FROM" "" ${ARGN})
|
||||
|
||||
if("${ARG_UNPARSED_ARGUMENTS}" STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass some relative files to ucm_remove_files()")
|
||||
endif()
|
||||
if(${ARG_FROM} STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass FROM and a variable name to ucm_remove_files()")
|
||||
endif()
|
||||
|
||||
foreach(cur_file ${ARG_UNPARSED_ARGUMENTS})
|
||||
list(REMOVE_ITEM ${ARG_FROM} ${cur_file})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# ucm_remove_directories
|
||||
# Removes all source files from the given directories from the sources list
|
||||
macro(ucm_remove_directories)
|
||||
cmake_parse_arguments(ARG "" "FROM" "MATCHES" ${ARGN})
|
||||
|
||||
if("${ARG_UNPARSED_ARGUMENTS}" STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass some relative directories to ucm_remove_directories()")
|
||||
endif()
|
||||
if(${ARG_FROM} STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass FROM and a variable name to ucm_remove_directories()")
|
||||
endif()
|
||||
|
||||
foreach(cur_dir ${ARG_UNPARSED_ARGUMENTS})
|
||||
foreach(cur_file ${${ARG_FROM}})
|
||||
string(REGEX MATCH ${cur_dir} res ${cur_file})
|
||||
if(NOT "${res}" STREQUAL "")
|
||||
if("${ARG_MATCHES}" STREQUAL "")
|
||||
list(REMOVE_ITEM ${ARG_FROM} ${cur_file})
|
||||
else()
|
||||
foreach(curr_ptrn ${ARG_MATCHES})
|
||||
string(REGEX MATCH ${curr_ptrn} res ${cur_file})
|
||||
if(NOT "${res}" STREQUAL "")
|
||||
list(REMOVE_ITEM ${ARG_FROM} ${cur_file})
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# ucm_add_files_impl
|
||||
macro(ucm_add_files_impl result trim files)
|
||||
foreach(cur_file ${files})
|
||||
SET(${result} ${${result}} ${cur_file})
|
||||
get_filename_component(FILEPATH ${cur_file} PATH)
|
||||
ucm_trim_front_words("${FILEPATH}" FILEPATH "${trim}")
|
||||
# replacing forward slashes with back slashes so filters can be generated (back slash used in parsing...)
|
||||
STRING(REPLACE "/" "\\" FILTERS "${FILEPATH}")
|
||||
SOURCE_GROUP("${FILTERS}" FILES ${cur_file})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# ucm_add_files
|
||||
# Adds files to a list of sources
|
||||
macro(ucm_add_files)
|
||||
cmake_parse_arguments(ARG "" "TO;FILTER_POP" "" ${ARGN})
|
||||
|
||||
if("${ARG_UNPARSED_ARGUMENTS}" STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass some relative files to ucm_add_files()")
|
||||
endif()
|
||||
if(${ARG_TO} STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass TO and a variable name to ucm_add_files()")
|
||||
endif()
|
||||
|
||||
if("${ARG_FILTER_POP}" STREQUAL "")
|
||||
set(ARG_FILTER_POP 0)
|
||||
endif()
|
||||
|
||||
ucm_add_files_impl(${ARG_TO} ${ARG_FILTER_POP} "${ARG_UNPARSED_ARGUMENTS}")
|
||||
endmacro()
|
||||
|
||||
# ucm_add_dir_impl
|
||||
macro(ucm_add_dir_impl result rec trim dirs_in additional_ext)
|
||||
set(dirs "${dirs_in}")
|
||||
|
||||
# handle the "" and "." cases
|
||||
if("${dirs}" STREQUAL "" OR "${dirs}" STREQUAL ".")
|
||||
set(dirs "./")
|
||||
endif()
|
||||
|
||||
foreach(cur_dir ${dirs})
|
||||
# to circumvent some linux/cmake/path issues - barely made it work...
|
||||
if(cur_dir STREQUAL "./")
|
||||
set(cur_dir "")
|
||||
else()
|
||||
set(cur_dir "${cur_dir}/")
|
||||
endif()
|
||||
|
||||
# since unix is case sensitive - add these valid extensions too
|
||||
# we don't use "UNIX" but instead "CMAKE_HOST_UNIX" because we might be cross
|
||||
# compiling (for example emscripten) under windows and UNIX may be set to 1
|
||||
# Also OSX is case insensitive like windows...
|
||||
set(additional_file_extensions "")
|
||||
if(CMAKE_HOST_UNIX AND NOT APPLE)
|
||||
set(additional_file_extensions
|
||||
"${cur_dir}*.CPP"
|
||||
"${cur_dir}*.C"
|
||||
"${cur_dir}*.H"
|
||||
"${cur_dir}*.HPP"
|
||||
)
|
||||
endif()
|
||||
|
||||
foreach(ext ${additional_ext})
|
||||
list(APPEND additional_file_extensions "${cur_dir}*.${ext}")
|
||||
endforeach()
|
||||
|
||||
# find all sources and set them as result
|
||||
FILE(GLOB found_sources RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
# https://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Overall-Options.html#index-file-name-suffix-71
|
||||
# sources
|
||||
"${cur_dir}*.cpp"
|
||||
"${cur_dir}*.cxx"
|
||||
"${cur_dir}*.c++"
|
||||
"${cur_dir}*.cc"
|
||||
"${cur_dir}*.cp"
|
||||
"${cur_dir}*.c"
|
||||
"${cur_dir}*.i"
|
||||
"${cur_dir}*.ii"
|
||||
# headers
|
||||
"${cur_dir}*.h"
|
||||
"${cur_dir}*.h++"
|
||||
"${cur_dir}*.hpp"
|
||||
"${cur_dir}*.hxx"
|
||||
"${cur_dir}*.hh"
|
||||
"${cur_dir}*.inl"
|
||||
"${cur_dir}*.inc"
|
||||
"${cur_dir}*.ipp"
|
||||
"${cur_dir}*.ixx"
|
||||
"${cur_dir}*.txx"
|
||||
"${cur_dir}*.tpp"
|
||||
"${cur_dir}*.tcc"
|
||||
"${cur_dir}*.tpl"
|
||||
${additional_file_extensions})
|
||||
SET(${result} ${${result}} ${found_sources})
|
||||
|
||||
# set the proper filters
|
||||
ucm_trim_front_words("${cur_dir}" cur_dir "${trim}")
|
||||
# replacing forward slashes with back slashes so filters can be generated (back slash used in parsing...)
|
||||
STRING(REPLACE "/" "\\" FILTERS "${cur_dir}")
|
||||
SOURCE_GROUP("${FILTERS}" FILES ${found_sources})
|
||||
endforeach()
|
||||
|
||||
if(${rec})
|
||||
foreach(cur_dir ${dirs})
|
||||
ucm_dir_list("${cur_dir}" subdirs)
|
||||
foreach(subdir ${subdirs})
|
||||
ucm_add_dir_impl(${result} ${rec} ${trim} "${cur_dir}/${subdir}" "${additional_ext}")
|
||||
endforeach()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# ucm_add_dirs
|
||||
# Adds all files from directories traversing them recursively to a list of sources
|
||||
# and generates filters according to their location (accepts relative paths only).
|
||||
# Also this macro trims X times the front word from the filter string for visual studio filters.
|
||||
macro(ucm_add_dirs)
|
||||
cmake_parse_arguments(ARG "RECURSIVE" "TO;FILTER_POP" "ADDITIONAL_EXT" ${ARGN})
|
||||
|
||||
if(${ARG_TO} STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass TO and a variable name to ucm_add_dirs()")
|
||||
endif()
|
||||
|
||||
if("${ARG_FILTER_POP}" STREQUAL "")
|
||||
set(ARG_FILTER_POP 0)
|
||||
endif()
|
||||
|
||||
ucm_add_dir_impl(${ARG_TO} ${ARG_RECURSIVE} ${ARG_FILTER_POP} "${ARG_UNPARSED_ARGUMENTS}" "${ARG_ADDITIONAL_EXT}")
|
||||
endmacro()
|
||||
|
||||
# ucm_add_target
|
||||
# Adds a target eligible for cotiring - unity build and/or precompiled header
|
||||
macro(ucm_add_target)
|
||||
cmake_parse_arguments(ARG "UNITY" "NAME;TYPE;PCH_FILE;CPP_PER_UNITY" "UNITY_EXCLUDED;SOURCES" ${ARGN})
|
||||
|
||||
if(NOT "${ARG_UNPARSED_ARGUMENTS}" STREQUAL "")
|
||||
message(FATAL_ERROR "Unrecognized options passed to ucm_add_target()")
|
||||
endif()
|
||||
if("${ARG_NAME}" STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass NAME and a name for the target to ucm_add_target()")
|
||||
endif()
|
||||
set(valid_types EXECUTABLE STATIC SHARED MODULE)
|
||||
list(FIND valid_types "${ARG_TYPE}" is_type_valid)
|
||||
if(${is_type_valid} STREQUAL "-1")
|
||||
message(FATAL_ERROR "Need to pass TYPE and the type for the target [EXECUTABLE/STATIC/SHARED/MODULE] to ucm_add_target()")
|
||||
endif()
|
||||
if("${ARG_SOURCES}" STREQUAL "")
|
||||
message(FATAL_ERROR "Need to pass SOURCES and a list of source files to ucm_add_target()")
|
||||
endif()
|
||||
|
||||
# init with the global unity flag
|
||||
set(do_unity ${UCM_UNITY_BUILD})
|
||||
|
||||
# check the UNITY argument
|
||||
if(NOT ARG_UNITY)
|
||||
set(do_unity FALSE)
|
||||
endif()
|
||||
|
||||
# if target is excluded through the exclusion list
|
||||
list(FIND UCM_UNITY_BUILD_EXCLUDE_TARGETS ${ARG_NAME} is_target_excluded)
|
||||
if(NOT ${is_target_excluded} STREQUAL "-1")
|
||||
set(do_unity FALSE)
|
||||
endif()
|
||||
|
||||
# unity build only for targets with > 1 source file (otherwise there will be an additional unnecessary target)
|
||||
if(do_unity) # optimization
|
||||
ucm_count_sources(${ARG_SOURCES} RESULT num_sources)
|
||||
if(${num_sources} LESS 2)
|
||||
set(do_unity FALSE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(wanted_cotire ${do_unity})
|
||||
|
||||
# if cotire cannot be used
|
||||
if(do_unity AND NOT ucm_with_cotire)
|
||||
set(do_unity FALSE)
|
||||
endif()
|
||||
|
||||
# inform the developer that the current target might benefit from a unity build
|
||||
if(NOT ARG_UNITY AND ${UCM_UNITY_BUILD})
|
||||
ucm_count_sources(${ARG_SOURCES} RESULT num_sources)
|
||||
if(${num_sources} GREATER 1)
|
||||
message(AUTHOR_WARNING "Target '${ARG_NAME}' may benefit from a unity build.\nIt has ${num_sources} sources - enable with UNITY flag")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# prepare for the unity build
|
||||
set(orig_target ${ARG_NAME})
|
||||
if(do_unity)
|
||||
# the original target will be added with a different name than the requested
|
||||
set(orig_target ${ARG_NAME}_ORIGINAL)
|
||||
|
||||
# exclude requested files from unity build of the current target
|
||||
foreach(excluded_file "${ARG_UNITY_EXCLUDED}")
|
||||
set_source_files_properties(${excluded_file} PROPERTIES COTIRE_EXCLUDED TRUE)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# add the original target
|
||||
if(${ARG_TYPE} STREQUAL "EXECUTABLE")
|
||||
add_executable(${orig_target} ${ARG_SOURCES})
|
||||
else()
|
||||
add_library(${orig_target} ${ARG_TYPE} ${ARG_SOURCES})
|
||||
endif()
|
||||
|
||||
if(do_unity)
|
||||
# set the number of unity cpp files to be used for the unity target
|
||||
if(NOT "${ARG_CPP_PER_UNITY}" STREQUAL "")
|
||||
set_property(TARGET ${orig_target} PROPERTY COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES "${ARG_CPP_PER_UNITY}")
|
||||
else()
|
||||
set_property(TARGET ${orig_target} PROPERTY COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES "100")
|
||||
endif()
|
||||
|
||||
if(NOT "${ARG_PCH_FILE}" STREQUAL "")
|
||||
set_target_properties(${orig_target} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${ARG_PCH_FILE}")
|
||||
else()
|
||||
set_target_properties(${orig_target} PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
|
||||
endif()
|
||||
# add a unity target for the original one with the name intended for the original
|
||||
set_target_properties(${orig_target} PROPERTIES COTIRE_UNITY_TARGET_NAME ${ARG_NAME})
|
||||
|
||||
# this is the library call that does the magic
|
||||
cotire(${orig_target})
|
||||
set_target_properties(clean_cotire PROPERTIES FOLDER "CMakePredefinedTargets")
|
||||
|
||||
# disable the original target and enable the unity one
|
||||
get_target_property(unity_target_name ${orig_target} COTIRE_UNITY_TARGET_NAME)
|
||||
set_target_properties(${orig_target} PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
|
||||
set_target_properties(${unity_target_name} PROPERTIES EXCLUDE_FROM_ALL 0 EXCLUDE_FROM_DEFAULT_BUILD 0)
|
||||
|
||||
# also set the name of the target output as the original one
|
||||
set_target_properties(${unity_target_name} PROPERTIES OUTPUT_NAME ${ARG_NAME})
|
||||
if(UCM_NO_COTIRE_FOLDER)
|
||||
# reset the folder property so all unity targets dont end up in a single folder in the solution explorer of VS
|
||||
set_target_properties(${unity_target_name} PROPERTIES FOLDER "")
|
||||
endif()
|
||||
set_target_properties(all_unity PROPERTIES FOLDER "CMakePredefinedTargets")
|
||||
elseif(NOT "${ARG_PCH_FILE}" STREQUAL "")
|
||||
set(wanted_cotire TRUE)
|
||||
if(ucm_with_cotire)
|
||||
set_target_properties(${orig_target} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
||||
set_target_properties(${orig_target} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${ARG_PCH_FILE}")
|
||||
cotire(${orig_target})
|
||||
set_target_properties(clean_cotire PROPERTIES FOLDER "CMakePredefinedTargets")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# print a message if the target was requested to be cotired but it couldn't
|
||||
if(wanted_cotire AND NOT ucm_with_cotire)
|
||||
if(NOT COMMAND cotire)
|
||||
message(AUTHOR_WARNING "Target \"${ARG_NAME}\" not cotired because cotire isn't loaded")
|
||||
else()
|
||||
message(AUTHOR_WARNING "Target \"${ARG_NAME}\" not cotired because cotire is older than the required version")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
192
docs/Makefile
192
docs/Makefile
|
@ -1,192 +0,0 @@
|
|||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# User-friendly check for sphinx-build
|
||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
||||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
||||
endif
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " applehelp to make an Apple Help Book"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
@echo " coverage to run coverage check of the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/xlnt.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/xlnt.qhc"
|
||||
|
||||
applehelp:
|
||||
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
|
||||
@echo
|
||||
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
|
||||
@echo "N.B. You won't be able to view it unless you put it in" \
|
||||
"~/Library/Documentation/Help or install it in your application" \
|
||||
"bundle."
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/xlnt"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/xlnt"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
latexpdfja:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
coverage:
|
||||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
||||
@echo "Testing of coverage in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/coverage/python.txt."
|
||||
|
||||
xml:
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
pseudoxml:
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
|
@ -0,0 +1,25 @@
|
|||
# Table of Contents
|
||||
|
||||
* [Read Me](/README.md)
|
||||
* [Introduction](/docs/introduction/README.md)
|
||||
* [Motivation](/docs/introduction/Motivation.md)
|
||||
* [Examples](/docs/introduction/Examples.md)
|
||||
* [Features](/docs/introduction/Features.md)
|
||||
* [Installation](/docs/introduction/Installation.md)
|
||||
* [Basics](/docs/basics/README.md)
|
||||
* [Workbook](/docs/basics/Workbook.md)
|
||||
* [Worksheet](/docs/basics/Worksheet.md)
|
||||
* [Cell](/docs/basics/Cell.md)
|
||||
* [Iteration](/docs/basics/Iteration.md)
|
||||
* [Advanced](/docs/advanced/README.md)
|
||||
* [Formatting](/docs/advanced/Formatting.md)
|
||||
* [Properties](/docs/advanced/Properties.md)
|
||||
* [Printing](/docs/advanced/Printing.md)
|
||||
* [Encryption](/docs/advanced/Encryption.md)
|
||||
* [Views](/docs/advanced/Views.md)
|
||||
* [API Reference](/docs/api/README.md)
|
||||
* [cell](/docs/api/cell.md)
|
||||
* [cell_reference](/docs/api/cell_reference.md)
|
||||
* [Change Log](/CHANGELOG.md)
|
||||
* [Contributing](/CONTRIBUTING.md)
|
||||
* [License](/LICENSE.md)
|
|
@ -0,0 +1 @@
|
|||
## Encryption
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
# Formatting
|
||||
|
||||
## Format vs. Style
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto cell = wb.active_sheet().cell("A1");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
In the context of xlnt, format and style have specific distinct meanings. A style in xlnt corresponds to a named style created in the "Cell styles" dropdown in Excel. It must have a name and optionally any of: alignment, border, fill, font, number format, protection. A format in xlnt corresponds to the alignment, border, fill, font, number format, and protection settings applied to a cell via right-click->"Format Cells". A cell can have both a format and a style. The style properties will generally override the format properties.
|
||||
|
||||
## Number Formatting
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto cell = wb.active_sheet().cell("A1");
|
||||
cell.number_format(xlnt::number_format::percentage());
|
||||
cell.value(0.513);
|
||||
std::cout << cell.to_string() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
An xlnt::number_format is the format code used when displaying a value in a cell. For example, a number_format of "0.00" implies that the number 13.726 should be displayed as "13.73". Many number formats are built-in to Excel and can be access with xlnt::number_format static constructors. Other custom number formats can be created by passing a string to the [xlnt::number_format constructor](#cell-const-cell-amp).
|
|
@ -0,0 +1 @@
|
|||
## Printing
|
|
@ -0,0 +1,54 @@
|
|||
# Properties
|
||||
|
||||
```c++
|
||||
xlnt::workbook wb;
|
||||
|
||||
wb.core_property(xlnt::core_property::category, "hors categorie");
|
||||
wb.core_property(xlnt::core_property::content_status, "good");
|
||||
wb.core_property(xlnt::core_property::created, xlnt::datetime(2017, 1, 15));
|
||||
wb.core_property(xlnt::core_property::creator, "me");
|
||||
wb.core_property(xlnt::core_property::description, "description");
|
||||
wb.core_property(xlnt::core_property::identifier, "id");
|
||||
wb.core_property(xlnt::core_property::keywords, { "wow", "such" });
|
||||
wb.core_property(xlnt::core_property::language, "Esperanto");
|
||||
wb.core_property(xlnt::core_property::last_modified_by, "someone");
|
||||
wb.core_property(xlnt::core_property::last_printed, xlnt::datetime(2017, 1, 15));
|
||||
wb.core_property(xlnt::core_property::modified, xlnt::datetime(2017, 1, 15));
|
||||
wb.core_property(xlnt::core_property::revision, "3");
|
||||
wb.core_property(xlnt::core_property::subject, "subject");
|
||||
wb.core_property(xlnt::core_property::title, "title");
|
||||
wb.core_property(xlnt::core_property::version, "1.0");
|
||||
|
||||
wb.extended_property(xlnt::extended_property::application, "xlnt");
|
||||
wb.extended_property(xlnt::extended_property::app_version, "0.9.3");
|
||||
wb.extended_property(xlnt::extended_property::characters, 123);
|
||||
wb.extended_property(xlnt::extended_property::characters_with_spaces, 124);
|
||||
wb.extended_property(xlnt::extended_property::company, "Incorporated Inc.");
|
||||
wb.extended_property(xlnt::extended_property::dig_sig, "?");
|
||||
wb.extended_property(xlnt::extended_property::doc_security, 0);
|
||||
wb.extended_property(xlnt::extended_property::heading_pairs, true);
|
||||
wb.extended_property(xlnt::extended_property::hidden_slides, false);
|
||||
wb.extended_property(xlnt::extended_property::h_links, 0);
|
||||
wb.extended_property(xlnt::extended_property::hyperlink_base, 0);
|
||||
wb.extended_property(xlnt::extended_property::hyperlinks_changed, true);
|
||||
wb.extended_property(xlnt::extended_property::lines, 42);
|
||||
wb.extended_property(xlnt::extended_property::links_up_to_date, false);
|
||||
wb.extended_property(xlnt::extended_property::manager, "johnny");
|
||||
wb.extended_property(xlnt::extended_property::m_m_clips, "?");
|
||||
wb.extended_property(xlnt::extended_property::notes, "note");
|
||||
wb.extended_property(xlnt::extended_property::pages, 19);
|
||||
wb.extended_property(xlnt::extended_property::paragraphs, 18);
|
||||
wb.extended_property(xlnt::extended_property::presentation_format, "format");
|
||||
wb.extended_property(xlnt::extended_property::scale_crop, true);
|
||||
wb.extended_property(xlnt::extended_property::shared_doc, false);
|
||||
wb.extended_property(xlnt::extended_property::slides, 17);
|
||||
wb.extended_property(xlnt::extended_property::template_, "template!");
|
||||
wb.extended_property(xlnt::extended_property::titles_of_parts, { "title" });
|
||||
wb.extended_property(xlnt::extended_property::total_time, 16);
|
||||
wb.extended_property(xlnt::extended_property::words, 101);
|
||||
|
||||
wb.custom_property("test", { 1, 2, 3 });
|
||||
wb.custom_property("Editor", "John Smith");
|
||||
|
||||
wb.save("lots_of_properties.xlsx");
|
||||
```
|
|
@ -0,0 +1,7 @@
|
|||
## Advanced
|
||||
|
||||
* [Formatting](Formatting.md)
|
||||
* [Properties](Properties.md)
|
||||
* [Printing](Printing.md)
|
||||
* [Encryption](Encryption.md)
|
||||
* [Views](Views.md)
|
|
@ -0,0 +1 @@
|
|||
## Views
|
|
@ -0,0 +1,4 @@
|
|||
## API
|
||||
|
||||
* [cell](cell.md)
|
||||
* [cell_reference](cell_reference.md)
|
|
@ -0,0 +1,188 @@
|
|||
# cell
|
||||
## ```using xlnt::cell::type = cell_typeundefined```
|
||||
Alias xlnt::cell_type to xlnt::cell::type since it looks nicer.
|
||||
## ```friend class detail::xlsx_consumerundefined```
|
||||
## ```friend class detail::xlsx_producerundefined```
|
||||
## ```friend struct detail::cell_implundefined```
|
||||
## ```static const std::unordered_map<std::string, int>& xlnt::cell::error_codes()```
|
||||
Returns a map of error strings such as #DIV/0! and their associated indices.
|
||||
## ```xlnt::cell::cell(const cell &)=default```
|
||||
Default copy constructor.
|
||||
## ```bool xlnt::cell::has_value() const```
|
||||
Returns true if value has been set and has not been cleared using cell::clear_value().
|
||||
## ```T xlnt::cell::value() const```
|
||||
Returns the value of this cell as an instance of type T. Overloads exist for most C++ fundamental types like bool, int, etc. as well as for std::string and xlnt datetime types: date, time, datetime, and timedelta.
|
||||
## ```void xlnt::cell::clear_value()```
|
||||
Makes this cell have a value of type null. All other cell attributes are retained.
|
||||
## ```void xlnt::cell::value(std::nullptr_t)```
|
||||
Sets the type of this cell to null.
|
||||
## ```void xlnt::cell::value(bool boolean_value)```
|
||||
Sets the value of this cell to the given boolean value.
|
||||
## ```void xlnt::cell::value(int int_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(unsigned int int_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(long long int int_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(unsigned long long int int_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(float float_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(double float_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(long double float_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(const date &date_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(const time &time_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(const datetime &datetime_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(const timedelta &timedelta_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(const std::string &string_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(const char *string_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(const rich_text &text_value)```
|
||||
Sets the value of this cell to the given value.
|
||||
## ```void xlnt::cell::value(const cell other_cell)```
|
||||
Sets the value and formatting of this cell to that of other_cell.
|
||||
## ```void xlnt::cell::value(const std::string &string_value, bool infer_type)```
|
||||
Analyzes string_value to determine its type, convert it to that type, and set the value of this cell to that converted value.
|
||||
## ```type xlnt::cell::data_type() const```
|
||||
Returns the type of this cell.
|
||||
## ```void xlnt::cell::data_type(type t)```
|
||||
Sets the type of this cell. This should usually be done indirectly by setting the value of the cell to a value of that type.
|
||||
## ```bool xlnt::cell::garbage_collectible() const```
|
||||
There's no reason to keep a cell which has no value and is not a placeholder. Returns true if this cell has no value, style, isn't merged, etc.
|
||||
## ```bool xlnt::cell::is_date() const```
|
||||
Returns true iff this cell's number format matches a date format.
|
||||
## ```cell_reference xlnt::cell::reference() const```
|
||||
Returns a cell_reference that points to the location of this cell.
|
||||
## ```column_t xlnt::cell::column() const```
|
||||
Returns the column of this cell.
|
||||
## ```row_t xlnt::cell::row() const```
|
||||
Returns the row of this cell.
|
||||
## ```std::pair<int, int> xlnt::cell::anchor() const```
|
||||
Returns the location of this cell as an ordered pair (left, top).
|
||||
## ```std::string xlnt::cell::hyperlink() const```
|
||||
Returns the URL of this cell's hyperlink.
|
||||
## ```void xlnt::cell::hyperlink(const std::string &url)```
|
||||
Adds a hyperlink to this cell pointing to the URL of the given value.
|
||||
## ```void xlnt::cell::hyperlink(const std::string &url, const std::string &display)```
|
||||
Adds a hyperlink to this cell pointing to the URI of the given value and sets the text value of the cell to the given parameter.
|
||||
## ```void xlnt::cell::hyperlink(xlnt::cell target)```
|
||||
Adds an internal hyperlink to this cell pointing to the given cell.
|
||||
## ```bool xlnt::cell::has_hyperlink() const```
|
||||
Returns true if this cell has a hyperlink set.
|
||||
## ```class alignment xlnt::cell::computed_alignment() const```
|
||||
Returns the alignment that should be used when displaying this cell graphically based on the workbook default, the cell-level format, and the named style applied to the cell in that order.
|
||||
## ```class border xlnt::cell::computed_border() const```
|
||||
Returns the border that should be used when displaying this cell graphically based on the workbook default, the cell-level format, and the named style applied to the cell in that order.
|
||||
## ```class fill xlnt::cell::computed_fill() const```
|
||||
Returns the fill that should be used when displaying this cell graphically based on the workbook default, the cell-level format, and the named style applied to the cell in that order.
|
||||
## ```class font xlnt::cell::computed_font() const```
|
||||
Returns the font that should be used when displaying this cell graphically based on the workbook default, the cell-level format, and the named style applied to the cell in that order.
|
||||
## ```class number_format xlnt::cell::computed_number_format() const```
|
||||
Returns the number format that should be used when displaying this cell graphically based on the workbook default, the cell-level format, and the named style applied to the cell in that order.
|
||||
## ```class protection xlnt::cell::computed_protection() const```
|
||||
Returns the protection that should be used when displaying this cell graphically based on the workbook default, the cell-level format, and the named style applied to the cell in that order.
|
||||
## ```bool xlnt::cell::has_format() const```
|
||||
Returns true if this cell has had a format applied to it.
|
||||
## ```const class format xlnt::cell::format() const```
|
||||
Returns the format applied to this cell. If this cell has no format, an invalid_attribute exception will be thrown.
|
||||
## ```void xlnt::cell::format(const class format new_format)```
|
||||
Applies the cell-level formatting of new_format to this cell.
|
||||
## ```void xlnt::cell::clear_format()```
|
||||
Removes the cell-level formatting from this cell. This doesn't affect the style that may also be applied to the cell. Throws an invalid_attribute exception if no format is applied.
|
||||
## ```class number_format xlnt::cell::number_format() const```
|
||||
Returns the number format of this cell.
|
||||
## ```void xlnt::cell::number_format(const class number_format &format)```
|
||||
Creates a new format in the workbook, sets its number_format to the given format, and applies the format to this cell.
|
||||
## ```class font xlnt::cell::font() const```
|
||||
Returns the font applied to the text in this cell.
|
||||
## ```void xlnt::cell::font(const class font &font_)```
|
||||
Creates a new format in the workbook, sets its font to the given font, and applies the format to this cell.
|
||||
## ```class fill xlnt::cell::fill() const```
|
||||
Returns the fill applied to this cell.
|
||||
## ```void xlnt::cell::fill(const class fill &fill_)```
|
||||
Creates a new format in the workbook, sets its fill to the given fill, and applies the format to this cell.
|
||||
## ```class border xlnt::cell::border() const```
|
||||
Returns the border of this cell.
|
||||
## ```void xlnt::cell::border(const class border &border_)```
|
||||
Creates a new format in the workbook, sets its border to the given border, and applies the format to this cell.
|
||||
## ```class alignment xlnt::cell::alignment() const```
|
||||
Returns the alignment of the text in this cell.
|
||||
## ```void xlnt::cell::alignment(const class alignment &alignment_)```
|
||||
Creates a new format in the workbook, sets its alignment to the given alignment, and applies the format to this cell.
|
||||
## ```class protection xlnt::cell::protection() const```
|
||||
Returns the protection of this cell.
|
||||
## ```void xlnt::cell::protection(const class protection &protection_)```
|
||||
Creates a new format in the workbook, sets its protection to the given protection, and applies the format to this cell.
|
||||
## ```bool xlnt::cell::has_style() const```
|
||||
Returns true if this cell has had a style applied to it.
|
||||
## ```class style xlnt::cell::style()```
|
||||
Returns a wrapper pointing to the named style applied to this cell.
|
||||
## ```const class style xlnt::cell::style() const```
|
||||
Returns a wrapper pointing to the named style applied to this cell.
|
||||
## ```void xlnt::cell::style(const class style &new_style)```
|
||||
Sets the named style applied to this cell to a style named style_name. Equivalent to style(new_style.name()).
|
||||
## ```void xlnt::cell::style(const std::string &style_name)```
|
||||
Sets the named style applied to this cell to a style named style_name. If this style has not been previously created in the workbook, a key_not_found exception will be thrown.
|
||||
## ```void xlnt::cell::clear_style()```
|
||||
Removes the named style from this cell. An invalid_attribute exception will be thrown if this cell has no style. This will not affect the cell format of the cell.
|
||||
## ```std::string xlnt::cell::formula() const```
|
||||
Returns the string representation of the formula applied to this cell.
|
||||
## ```void xlnt::cell::formula(const std::string &formula)```
|
||||
Sets the formula of this cell to the given value. This formula string should begin with '='.
|
||||
## ```void xlnt::cell::clear_formula()```
|
||||
Removes the formula from this cell. After this is called, has_formula() will return false.
|
||||
## ```bool xlnt::cell::has_formula() const```
|
||||
Returns true if this cell has had a formula applied to it.
|
||||
## ```std::string xlnt::cell::to_string() const```
|
||||
Returns a string representing the value of this cell. If the data type is not a string, it will be converted according to the number format.
|
||||
## ```bool xlnt::cell::is_merged() const```
|
||||
Returns true iff this cell has been merged with one or more surrounding cells.
|
||||
## ```void xlnt::cell::merged(bool merged)```
|
||||
Makes this a merged cell iff merged is true. Generally, this shouldn't be called directly. Instead, use worksheet::merge_cells on its parent worksheet.
|
||||
## ```std::string xlnt::cell::error() const```
|
||||
Returns the error string that is stored in this cell.
|
||||
## ```void xlnt::cell::error(const std::string &error)```
|
||||
Directly assigns the value of this cell to be the given error.
|
||||
## ```cell xlnt::cell::offset(int column, int row)```
|
||||
Returns a cell from this cell's parent workbook at a relative offset given by the parameters.
|
||||
## ```class worksheet xlnt::cell::worksheet()```
|
||||
Returns the worksheet that owns this cell.
|
||||
## ```const class worksheet xlnt::cell::worksheet() const```
|
||||
Returns the worksheet that owns this cell.
|
||||
## ```class workbook& xlnt::cell::workbook()```
|
||||
Returns the workbook of the worksheet that owns this cell.
|
||||
## ```const class workbook& xlnt::cell::workbook() const```
|
||||
Returns the workbook of the worksheet that owns this cell.
|
||||
## ```calendar xlnt::cell::base_date() const```
|
||||
Returns the base date of the parent workbook.
|
||||
## ```std::string xlnt::cell::check_string(const std::string &to_check)```
|
||||
Returns to_check after verifying and fixing encoding, size, and illegal characters.
|
||||
## ```bool xlnt::cell::has_comment()```
|
||||
Returns true if this cell has a comment applied.
|
||||
## ```void xlnt::cell::clear_comment()```
|
||||
Deletes the comment applied to this cell if it exists.
|
||||
## ```class comment xlnt::cell::comment()```
|
||||
Gets the comment applied to this cell.
|
||||
## ```void xlnt::cell::comment(const std::string &text, const std::string &author="Microsoft Office User")```
|
||||
Creates a new comment with the given text and optional author and applies it to the cell.
|
||||
## ```void xlnt::cell::comment(const std::string &comment_text, const class font &comment_font, const std::string &author="Microsoft Office User")```
|
||||
Creates a new comment with the given text, formatting, and optional author and applies it to the cell.
|
||||
## ```void xlnt::cell::comment(const class comment &new_comment)```
|
||||
Apply the comment provided as the only argument to the cell.
|
||||
## ```double xlnt::cell::width() const```
|
||||
Returns the width of this cell in pixels.
|
||||
## ```double xlnt::cell::height() const```
|
||||
Returns the height of this cell in pixels.
|
||||
## ```cell& xlnt::cell::operator=(const cell &rhs)```
|
||||
Makes this cell interally point to rhs. The cell data originally pointed to by this cell will be unchanged.
|
||||
## ```bool xlnt::cell::operator==(const cell &comparand) const```
|
||||
Returns true if this cell the same cell as comparand (compared by reference).
|
||||
## ```bool xlnt::cell::operator==(std::nullptr_t) const```
|
||||
Returns true if this cell is uninitialized.
|
|
@ -0,0 +1,55 @@
|
|||
# cell_reference
|
||||
## ```static std::pair<std::string, row_t> xlnt::cell_reference::split_reference(const std::string &reference_string)```
|
||||
Splits a coordinate string like "A1" into an equivalent pair like {"A", 1}.
|
||||
## ```static std::pair<std::string, row_t> xlnt::cell_reference::split_reference(const std::string &reference_string, bool &absolute_column, bool &absolute_row)```
|
||||
Splits a coordinate string like "A1" into an equivalent pair like {"A", 1}. Reference parameters absolute_column and absolute_row will be set to true if column part or row part are prefixed by a dollar-sign indicating they are absolute, otherwise false.
|
||||
## ```xlnt::cell_reference::cell_reference()```
|
||||
Default constructor makes a reference to the top-left-most cell, "A1".
|
||||
## ```xlnt::cell_reference::cell_reference(const char *reference_string)```
|
||||
Constructs a cell_reference from a string reprenting a cell coordinate (e.g. $B14).
|
||||
## ```xlnt::cell_reference::cell_reference(const std::string &reference_string)```
|
||||
Constructs a cell_reference from a string reprenting a cell coordinate (e.g. $B14).
|
||||
## ```xlnt::cell_reference::cell_reference(column_t column, row_t row)```
|
||||
Constructs a cell_reference from a 1-indexed column index and row index.
|
||||
## ```cell_reference& xlnt::cell_reference::make_absolute(bool absolute_column=true, bool absolute_row=true)```
|
||||
Converts a coordinate to an absolute coordinate string (e.g. B12 -> $B$12) Defaulting to true, absolute_column and absolute_row can optionally control whether the resulting cell_reference has an absolute column (e.g. B12 -> $B12) and absolute row (e.g. B12 -> B$12) respectively.
|
||||
## ```bool xlnt::cell_reference::column_absolute() const```
|
||||
Returns true if the reference refers to an absolute column, otherwise false.
|
||||
## ```void xlnt::cell_reference::column_absolute(bool absolute_column)```
|
||||
Makes this reference have an absolute column if absolute_column is true, otherwise not absolute.
|
||||
## ```bool xlnt::cell_reference::row_absolute() const```
|
||||
Returns true if the reference refers to an absolute row, otherwise false.
|
||||
## ```void xlnt::cell_reference::row_absolute(bool absolute_row)```
|
||||
Makes this reference have an absolute row if absolute_row is true, otherwise not absolute.
|
||||
## ```column_t xlnt::cell_reference::column() const```
|
||||
Returns a string that identifies the column of this reference (e.g. second column from left is "B")
|
||||
## ```void xlnt::cell_reference::column(const std::string &column_string)```
|
||||
Sets the column of this reference from a string that identifies a particular column.
|
||||
## ```column_t::index_t xlnt::cell_reference::column_index() const```
|
||||
Returns a 1-indexed numeric index of the column of this reference.
|
||||
## ```void xlnt::cell_reference::column_index(column_t column)```
|
||||
Sets the column of this reference from a 1-indexed number that identifies a particular column.
|
||||
## ```row_t xlnt::cell_reference::row() const```
|
||||
Returns a 1-indexed numeric index of the row of this reference.
|
||||
## ```void xlnt::cell_reference::row(row_t row)```
|
||||
Sets the row of this reference from a 1-indexed number that identifies a particular row.
|
||||
## ```cell_reference xlnt::cell_reference::make_offset(int column_offset, int row_offset) const```
|
||||
Returns a cell_reference offset from this cell_reference by the number of columns and rows specified by the parameters. A negative value for column_offset or row_offset results in a reference above or left of this cell_reference, respectively.
|
||||
## ```std::string xlnt::cell_reference::to_string() const```
|
||||
Returns a string like "A1" for cell_reference(1, 1).
|
||||
## ```range_reference xlnt::cell_reference::to_range() const```
|
||||
Returns a 1x1 range_reference containing only this cell_reference.
|
||||
## ```range_reference xlnt::cell_reference::operator,(const cell_reference &other) const```
|
||||
I've always wanted to overload the comma operator. cell_reference("A", 1), cell_reference("B", 1) will return range_reference(cell_reference("A", 1), cell_reference("B", 1))
|
||||
## ```bool xlnt::cell_reference::operator==(const cell_reference &comparand) const```
|
||||
Returns true if this reference is identical to comparand including in absoluteness of column and row.
|
||||
## ```bool xlnt::cell_reference::operator==(const std::string &reference_string) const```
|
||||
Constructs a cell_reference from reference_string and return the result of their comparison.
|
||||
## ```bool xlnt::cell_reference::operator==(const char *reference_string) const```
|
||||
Constructs a cell_reference from reference_string and return the result of their comparison.
|
||||
## ```bool xlnt::cell_reference::operator!=(const cell_reference &comparand) const```
|
||||
Returns true if this reference is not identical to comparand including in absoluteness of column and row.
|
||||
## ```bool xlnt::cell_reference::operator!=(const std::string &reference_string) const```
|
||||
Constructs a cell_reference from reference_string and return the result of their comparison.
|
||||
## ```bool xlnt::cell_reference::operator!=(const char *reference_string) const```
|
||||
Constructs a cell_reference from reference_string and return the result of their comparison.
|
|
@ -1,30 +0,0 @@
|
|||
Cell Module
|
||||
===========
|
||||
|
||||
.. doxygenstruct:: xlnt::cell_reference_hash
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::cell_reference
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::cell_type
|
||||
|
||||
.. doxygenclass:: xlnt::cell
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::comment
|
||||
:members:
|
||||
|
||||
.. doxygentypedef:: xlnt::row_t
|
||||
|
||||
.. doxygenclass:: xlnt::column_t
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::column_hash
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::formatted_text
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::text_run
|
||||
:members:
|
|
@ -1,11 +0,0 @@
|
|||
Packaging Module
|
||||
================
|
||||
|
||||
.. doxygenclass:: xlnt::manifest
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::relationship
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::uri
|
||||
:members:
|
|
@ -1,11 +0,0 @@
|
|||
Library Modules
|
||||
===============
|
||||
|
||||
.. toctree::
|
||||
|
||||
xlnt.cell
|
||||
xlnt.packaging
|
||||
xlnt.styles
|
||||
xlnt.utils
|
||||
xlnt.workbook
|
||||
xlnt.worksheet
|
|
@ -1,37 +0,0 @@
|
|||
Styles Module
|
||||
=============
|
||||
|
||||
.. doxygenclass:: xlnt::alignment
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::border_style
|
||||
|
||||
.. doxygenclass:: xlnt::border
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::color
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::diagonal_direction
|
||||
|
||||
.. doxygenclass:: xlnt::fill
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::font
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::format
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::horizontal_alignment
|
||||
|
||||
.. doxygenclass:: xlnt::number_format
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::protection
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::style
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::vertical_alignment
|
|
@ -1,68 +0,0 @@
|
|||
Utilities Module
|
||||
================
|
||||
|
||||
.. doxygenclass:: xlnt::exception
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_parameter
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_sheet_title
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::missing_number_format
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_file
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::illegal_character
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_data_type
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_column_string_index
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_cell_reference
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::invalid_attribute
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::key_not_found
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::no_visible_worksheets
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::unhandled_switch_case
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::unsupported
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::calendar
|
||||
|
||||
.. doxygenstruct:: xlnt::date
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::datetime
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::time
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::timedelta
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::utf8string
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::optional
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::path
|
||||
:members:
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
Workbook Module
|
||||
===============
|
||||
|
||||
.. doxygenclass:: xlnt::const_worksheet_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::document_security
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::external_book
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::named_range
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::theme
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::workbook
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::worksheet_iterator
|
||||
:members:
|
|
@ -1,72 +0,0 @@
|
|||
Worksheet Module
|
||||
================
|
||||
|
||||
.. doxygenclass:: xlnt::cell_vector
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::cell_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::column_properties
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::const_cell_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::const_range_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::footer
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::header_footer
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::header
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::major_order
|
||||
|
||||
.. doxygenenum:: xlnt::orientation
|
||||
|
||||
.. doxygenenum:: xlnt::page_break
|
||||
|
||||
.. doxygenclass:: xlnt::page_margins
|
||||
:members:
|
||||
|
||||
.. doxygenstruct:: xlnt::page_setup
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::pane
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::paper_size
|
||||
|
||||
.. doxygenclass:: xlnt::range_iterator
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::range_reference
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::range
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::row_properties
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::selection
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::sheet_protection
|
||||
:members:
|
||||
|
||||
.. doxygenenum:: xlnt::sheet_state
|
||||
|
||||
.. doxygenclass:: xlnt::sheet_view
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::worksheet_properties
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: xlnt::worksheet
|
||||
:members:
|
|
@ -0,0 +1 @@
|
|||
## Cell
|
|
@ -0,0 +1 @@
|
|||
## Iteration
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
# Memory Model
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
void set_cell(xlnt::cell cell, int value)
|
||||
{
|
||||
cell.value(value);
|
||||
}
|
||||
|
||||
xlnt::workbook create_wb()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.active_sheet();
|
||||
set_cell(wb.cell("A1"), 2);
|
||||
return wb;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
auto wb = create_wb();
|
||||
std::cout << wb.value<int>() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
xlnt uses the pimpl idiom for most of its core data structures. This primary reason for choosing this technique was simplifying usage of the library. Instead of using pointers or references, classes can be passed around by value. Internally they hold a pointer to memory which is within the primary workbook implementation struct. Methods called on the wrapper object dereference the opaque pointer and manipulate its data directly.
|
||||
|
||||
For the user, this means that workbooks, worksheets, cells, formats, and styles can be passed and stored by value.
|
|
@ -0,0 +1,6 @@
|
|||
## Basics
|
||||
|
||||
* [Workbook](/docs/basics/Workbook.md)
|
||||
* [Worksheet](/docs/basics/Worksheet.md)
|
||||
* [Cell](/docs/basics/Cell.md)
|
||||
* [Iteration](/docs/basics/Iteration.md)
|
|
@ -0,0 +1 @@
|
|||
## Workbook
|
|
@ -0,0 +1 @@
|
|||
## Worksheet
|
|
@ -1,4 +0,0 @@
|
|||
0.9.0 (unreleased)
|
||||
==================
|
||||
|
||||
Beta release
|
|
@ -1,4 +0,0 @@
|
|||
Charts
|
||||
======
|
||||
|
||||
Charts aren't supported yet.
|
|
@ -1,36 +0,0 @@
|
|||
Comments
|
||||
========
|
||||
|
||||
Adding a comment to a cell
|
||||
--------------------------
|
||||
|
||||
Comments have a text attribute and an author attribute, which must both be set.
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
xlnt::workbook workbook;
|
||||
auto worksheet = workbook.get_active_sheet();
|
||||
auto comment = worksheet.get_cell("A1").get_comment();
|
||||
comment = xlnt::comment("This is the comment text", "Comment Author");
|
||||
std::cout << comment.get_text() << std::endl;
|
||||
std::cout << comment.get_author() << std::endl;
|
||||
|
||||
You cannot assign the same Comment object to two different cells. Doing so
|
||||
raises an xlnt::attribute_error.
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
xlnt::workbook workbook;
|
||||
auto worksheet = workbook.get_active_sheet();
|
||||
xlnt::comment comment("Text", "Author");
|
||||
worksheet.get_cell("A1").set_comment(comment);
|
||||
worksheet.get_cell("B1").set_comment(comment);
|
||||
|
||||
// prints: terminate called after throwing an instance of 'xlnt::attribute_error'
|
||||
|
||||
Loading and saving comments
|
||||
----------------------------
|
||||
|
||||
Comments present in a workbook when loaded are stored in the comment
|
||||
attribute of their respective cells automatically. Comments remaining in a workbook when it is saved are automatically saved to
|
||||
the workbook file.
|
300
docs/conf.py
300
docs/conf.py
|
@ -1,300 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# xlnt documentation build configuration file, created by
|
||||
# sphinx-quickstart on Mon Oct 26 10:31:07 2015.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import shlex
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
if on_rtd:
|
||||
from subprocess import call
|
||||
call('doxygen Doxyfile', shell=True)
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.todo',
|
||||
'sphinx.ext.viewcode',
|
||||
'breathe'
|
||||
]
|
||||
|
||||
# Breathe extension variables
|
||||
breathe_projects = { "xlnt" : "doxyxml/" }
|
||||
breathe_default_project = "xlnt"
|
||||
breathe_doxygen_config_options = {'EXCLUDE_SYMBOLS': 'XLNT_API'}
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
# source_suffix = ['.rst', '.md']
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = 'xlnt'
|
||||
copyright = '2015, Thomas Fussell'
|
||||
author = 'Thomas Fussell'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.9'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.9'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Language to be used for generating the HTML full-text search index.
|
||||
# Sphinx supports the following languages:
|
||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
|
||||
# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
|
||||
#html_search_language = 'en'
|
||||
|
||||
# A dictionary with options for the search language support, empty by default.
|
||||
# Now only 'ja' uses this config value
|
||||
#html_search_options = {'type': 'default'}
|
||||
|
||||
# The name of a javascript file (relative to the configuration directory) that
|
||||
# implements a search results scorer. If empty, the default will be used.
|
||||
#html_search_scorer = 'scorer.js'
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'xlntdoc'
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'xlnt.tex', 'xlnt Documentation',
|
||||
'Thomas Fussell', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'xlnt', 'xlnt Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'xlnt', 'xlnt Documentation',
|
||||
author, 'xlnt', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
|
@ -1,204 +0,0 @@
|
|||
Simple usage
|
||||
============
|
||||
|
||||
Write a workbook
|
||||
----------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
|
||||
std::string dest_filename = "empty_book.xlsx";
|
||||
|
||||
auto ws1 = wb.get_active_sheet();
|
||||
ws1.set_title("range names");
|
||||
|
||||
for(xlnt::row_t row = 1; row < 40; row++)
|
||||
{
|
||||
std::vector<int> to_append(600, 0);
|
||||
std::iota(std::begin(to_append), std::end(to_append), 0);
|
||||
ws1.append(to_append);
|
||||
}
|
||||
|
||||
auto ws2 = wb.create_sheet("Pi");
|
||||
|
||||
ws2.get_cell("F5").set_value(3.14);
|
||||
|
||||
for(xlnt::row_t row = 10; row < 20; row++)
|
||||
{
|
||||
for(xlnt::column_t column = 27; column < 54; column++)
|
||||
{
|
||||
ws3.get_cell(column, row).set_value(column.column_string());
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << ws3.get_cell("AA10") << std::endl;
|
||||
|
||||
wb.save(dest_filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Read an existing workbook
|
||||
-------------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
wb.load("empty_book.xlsx");
|
||||
auto sheet_ranges = wb.get_range("range names");
|
||||
|
||||
std::cout << sheet_ranges["D18"] << std::endl;
|
||||
// prints: 3
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
.. note ::
|
||||
|
||||
There are several optional parameters that can be used in xlnt::workbook::load (in order):
|
||||
|
||||
- `guess_types` will enable or disable (default) type inference when
|
||||
reading cells.
|
||||
|
||||
- `data_only` controls whether cells with formulae have either the
|
||||
formula (default) or the value stored the last time Excel read the sheet.
|
||||
|
||||
- `keep_vba` controls whether any Visual Basic elements are preserved or
|
||||
not (default). If they are preserved they are still not editable.
|
||||
|
||||
|
||||
.. warning ::
|
||||
|
||||
xlnt does currently not read all possible items in an Excel file so
|
||||
images and charts will be lost from existing files if they are opened and
|
||||
saved with the same name.
|
||||
|
||||
|
||||
Using number formats
|
||||
--------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
wb.guess_types(true);
|
||||
|
||||
auto ws = wb.get_active_sheet();
|
||||
ws.get_cell("A1").set_value(xlnt::datetime(2010, 7, 21));
|
||||
std::cout << ws.get_cell("A1").get_number_format().get_format_string() << std::endl
|
||||
// prints: yyyy-mm-dd h:mm:ss
|
||||
|
||||
// set percentage using a string followed by the percent sign
|
||||
ws.get_cell("B1").set_value("3.14%");
|
||||
std::cout << cell.get_value<long double>() << std::endl;
|
||||
// prints: 0.031400000000000004
|
||||
std::cout << cell << std::endl;
|
||||
// prints: 3.14%
|
||||
std::cout << cell.get_number_format().get_format_string() << std::endl;
|
||||
// prints: 0%
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Using formulae
|
||||
--------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.get_active_sheet();
|
||||
ws.get_cell("A1").set_formula("=SUM(1, 1)");
|
||||
wb.save("formula.xlsx");
|
||||
}
|
||||
|
||||
.. warning::
|
||||
NB you must use the English name for a function and function arguments *must* be separated by commas and not other punctuation such as semi-colons.
|
||||
|
||||
xlsx never evaluates formula but it is possible to check the name of a formula:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
bool found = xlnt::formulae::exists("HEX2DEC");
|
||||
std::cout << (found ? "True" : "False") << std::endl;
|
||||
// prints: True
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
If you're trying to use a formula that isn't known this could be because you're using a formula that was not included in the initial specification. Such formulae must be prefixed with `xlfn.` to work.
|
||||
|
||||
Merge / Unmerge cells
|
||||
---------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.get_active_sheet();
|
||||
|
||||
ws.merge_cells("A1:B1");
|
||||
ws.unmerge_cells("A1:B1");
|
||||
|
||||
// or
|
||||
|
||||
ws.merge_cells(1, 2, 4, 2)
|
||||
ws.unmerge_cells(1, 2, 4, 2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Inserting an image
|
||||
-------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.get_active_sheet();
|
||||
ws.get_cell("A1").set_value("You should see three logos below");
|
||||
|
||||
// create an image
|
||||
auto img = xlnt::image("logo.png");
|
||||
|
||||
// add to worksheet and anchor next to cells
|
||||
ws.add_image(img, "A1");
|
||||
wb.save("logo.xlsx");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Fold columns (outline)
|
||||
----------------------
|
||||
.. code-block:: cpp
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
auto ws = wb.create_sheet();
|
||||
bool hidden = true;
|
||||
ws.group_columns("A", "D", hidden);
|
||||
wb.save("group.xlsx");
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
Development
|
||||
===========
|
||||
|
||||
What is suppoprted
|
||||
------------------
|
||||
|
||||
Supporting different platforms
|
||||
------------------------------
|
||||
|
||||
Coding style
|
||||
------------
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
Coverage
|
||||
++++++++
|
||||
|
||||
Organisation
|
||||
++++++++++++
|
||||
|
||||
Checking XML
|
||||
++++++++++++
|
||||
|
||||
Schema validation
|
||||
+++++++++++++++++
|
||||
|
||||
Microsoft Tools
|
||||
+++++++++++++++
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
Contributions in the form of pull requests are always welcome. Don't forget
|
||||
to add yourself to the list of authors!
|
||||
|
||||
Branch naming convention
|
||||
------------------------
|
||||
|
||||
Pull Requests
|
||||
-------------
|
||||
|
||||
Documentation
|
||||
+++++++++++++
|
||||
|
||||
Benchmarking
|
||||
------------
|
||||
|
||||
Memory Use
|
||||
++++++++++
|
|
@ -1,4 +0,0 @@
|
|||
Conditional Formatting
|
||||
======================
|
||||
|
||||
Not supported yet.
|
106
docs/formula.rst
106
docs/formula.rst
|
@ -1,106 +0,0 @@
|
|||
Parsing Formulas
|
||||
================
|
||||
|
||||
`xlnt` supports limited parsing of formulas embedded in cells. The
|
||||
`xlnt/formula` module contains a `tokenizer` class to break
|
||||
formulas into their consitutuent tokens. Usage is as follows:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string formula = R"(=IF($A$1,"then True",MAX(DEFAULT_VAL,'Sheet 2'!B1)))";
|
||||
xlnt::tokenizer tok(formula);
|
||||
tok.parse();
|
||||
|
||||
for(auto &t : tok.get_items())
|
||||
{
|
||||
std::cout << t.get_value() << "\t" << t.get_type() << "\t" << t.get_subtype() << std::endl;
|
||||
}
|
||||
|
||||
// prints:
|
||||
//
|
||||
// IF( FUNC OPEN
|
||||
// $A$1 OPERAND RANGE
|
||||
// , SEP ARG
|
||||
// "then True" OPERAND TEXT
|
||||
// , SEP ARG
|
||||
// MAX( FUNC OPEN
|
||||
// DEFAULT_VAL OPERAND RANGE
|
||||
// , SEP ARG
|
||||
// 'Sheet 2'!B1 OPERAND RANGE
|
||||
// ) FUNC CLOSE
|
||||
// ) FUNC CLOSE
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
As shown above, tokens have three attributes of interest:
|
||||
|
||||
* ``.value``: The substring of the formula that produced this token
|
||||
|
||||
* ``.type``: The type of token this represents. Can be one of
|
||||
|
||||
- ``token::literal``: If the cell does not contain a formula, its
|
||||
value is represented by a single ``LITERAL`` token.
|
||||
|
||||
- ``token::operand``: A generic term for any value in the Excel
|
||||
formula. (See ``.subtype`` below for more details).
|
||||
|
||||
- ``token::func``: Function calls are broken up into tokens for the
|
||||
opener (e.g., ``SUM(``), followed by the arguments, followed by
|
||||
the closer (i.e., ``)``). The function name and opening
|
||||
parenthesis together form one ``FUNC`` token, and the matching
|
||||
parenthesis forms another ``FUNC`` token.
|
||||
|
||||
- ``token::array``: Array literals (enclosed between curly braces)
|
||||
get two ``ARRAY`` tokens each, one for the opening ``{`` and one
|
||||
for the closing ``}``.
|
||||
|
||||
- ``token::paren``: When used for grouping subexpressions (and not to
|
||||
denote function calls), parentheses are tokenized as ``paren``
|
||||
tokens (one per character).
|
||||
|
||||
- ``token::sep``: These tokens are created from either commas (``,``)
|
||||
or semicolons (``;``). Commas create ``sep`` tokens when they are
|
||||
used to separate function arguments (e.g., ``SUM(a,b)``) or when
|
||||
they are used to separate array elements (e.g., ``{a,b}``). (They
|
||||
have another use as an infix operator for joining
|
||||
ranges). Semicolons are always used to separate rows in an array
|
||||
literal, so always create ``sep`` tokens.
|
||||
|
||||
- ``token::op_pre``: Designates a prefix unary operator. Its value is
|
||||
always ``+`` or ``-``
|
||||
|
||||
- ``token::op_in``: Designates an infix binary operator. Possible
|
||||
values are ``>=``, ``<=``, ``<>``, ``=``, ``>``, ``<``, ``*``,
|
||||
``/``, ``+``, ``-``, ``^``, or ``&``.
|
||||
|
||||
- ``token::op_post``: Designates a postfix unary operator. Its value
|
||||
is always ``%``.
|
||||
|
||||
- ``token::wspace``: Created for any whitespace encountered. Its
|
||||
value is always a single space, regardless of how much whitespace
|
||||
is found.
|
||||
|
||||
* ``.subtype``: Some of the token types above use the subtype to
|
||||
provide additional information about the token. Possible subtypes
|
||||
are:
|
||||
|
||||
+ ``token::text``, ``token::number``, ``token::logical``,
|
||||
``token::error``, ``token::range``: these subtypes describe the
|
||||
various forms of ``operand`` found in formulae. ``logical`` is
|
||||
either ``true`` or ``false``, ``range`` is either a named range or
|
||||
a direct reference to another range. ``text``, ``number``, and
|
||||
``error`` all refer to literal values in the formula
|
||||
|
||||
+ ``token::open`` and ``token::close``: these two subtypes are used by
|
||||
``paren``, ``func``, and ``array``, to describe whether the token
|
||||
is opening a new subexpression or closing it.
|
||||
|
||||
+ ``token::arg`` and ``token::row``: are used by the ``sep`` tokens,
|
||||
to distinguish between the comma and semicolon. Commas produce
|
||||
tokens of subtype ``arg`` whereas semicolons produce tokens of
|
||||
subtype ``row``
|
232
docs/index.rst
232
docs/index.rst
|
@ -1,232 +0,0 @@
|
|||
:mod:`xlnt` - user-friendly xlsx library for C++14
|
||||
===========================================================================
|
||||
|
||||
.. module:: xlnt
|
||||
.. moduleauthor:: Thomas Fussell
|
||||
|
||||
:Author: Thomas Fussell
|
||||
:Source code: https://github.com/tfussell/xlnt
|
||||
:Issues: https://github.com/tfussell/xlnt/issues
|
||||
:Generated: |today|
|
||||
:License: MIT
|
||||
:Version: |release|
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
xlnt is a C++14 library for reading, writing, and modifying XLSX files as described in [ECMA 376](http://www.ecma-international.org/publications/standards/Ecma-376.htm). The API is based on [openpyxl](https://bitbucket.org/openpyxl/openpyxl), a Python library to read/write Excel 2007 xlsx/xlsm files, and ultimately on [PHPExcel](https://github.com/PHPOffice/PHPExcel), pure PHP library for reading and writing spreadsheet files upon which openpyxl was based. This project is still very much a work in progress, but the core development work is complete.
|
||||
|
||||
Summary of Features
|
||||
+++++++++++++++++++
|
||||
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Feature | Read | Edit | Write |
|
||||
+=====================================================================+======+======+=======+
|
||||
| Excel-style Workbook | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| LibreOffice-style Workbook | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Numbers-style Workbook | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Encrypted Workbook (Excel 2007-2010) | ✓ | ✓ | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Encrypted Workbook (Excel 2013-2016) | ✓ | ✓ | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Excel Binary Workbook (.xlsb) | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Excel Macro-Enabled Workbook (.xlsm) | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Excel Macro-Enabled Template (.xltm) | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Document Properties | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Numeric Cell Values | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Inline String Cell Values | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Shared String Cell Values | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Shared String Text Run Formatting (e.g. varied fonts within a cell) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Hyperlink Cell Values | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formula Cell Values | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formula Evaluation | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Page Margins | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Page Setup | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Print Area | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Comments | ✓ | ✓ | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Header and Footer | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Custom Views | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Charts | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Chartsheets | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Dialogsheets | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Themes | ✓ | | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Cell Styles | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Cell Formats | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Alignment (e.g. right align) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Border (e.g. red cell outline) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Fill (e.g. green cell background) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Font (e.g. blue cell text) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Number Format (e.g. show 2 decimals) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Formatting->Protection (e.g. hide formulas) | ✓ | ✓ | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Column Styles | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Row Styles | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Sheet Styles | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Conditional Formatting | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Tables | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Table Formatting | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Pivot Tables | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| XLSX Thumbnail | ✓ | | ✓ |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Custom OOXML Properties | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Custom OOXML Parts | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Drawing | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Text Box | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| WordArt | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Embedded Content (e.g. images) | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
| Excel VBA | | | |
|
||||
+---------------------------------------------------------------------+------+------+-------+
|
||||
|
||||
Sample code:
|
||||
++++++++++++
|
||||
|
||||
.. literalinclude:: ../samples/sample.cpp
|
||||
|
||||
|
||||
How to Contribute Code
|
||||
----------------------
|
||||
|
||||
See `Information For Developers`_
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Getting the source
|
||||
------------------
|
||||
|
||||
Usage examples
|
||||
--------------
|
||||
|
||||
Tutorial
|
||||
++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
tutorial
|
||||
|
||||
Cookbook
|
||||
++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
cookbook
|
||||
|
||||
Charts
|
||||
++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
charts/introduction
|
||||
|
||||
Comments
|
||||
++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
comments
|
||||
|
||||
Working with styles
|
||||
+++++++++++++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
styles
|
||||
|
||||
Conditional Formatting
|
||||
++++++++++++++++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
formatting
|
||||
|
||||
Data Validation
|
||||
+++++++++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
validation
|
||||
|
||||
Parsing Formulas
|
||||
++++++++++++++++
|
||||
|
||||
.. toctree::
|
||||
|
||||
formula
|
||||
|
||||
|
||||
Information for Developers
|
||||
--------------------------
|
||||
|
||||
.. toctree::
|
||||
|
||||
development
|
||||
windows-development
|
||||
|
||||
API Documentation
|
||||
------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
api/xlnt
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
|
||||
Release Notes
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
changes
|
|
@ -0,0 +1,195 @@
|
|||
## Examples
|
||||
|
||||
### Simple - reading from an existing xlsx spread sheet.
|
||||
|
||||
The following C plus plus code will read the values from an xlsx file and print the string values to the screen. This is a very simple example to get you started.
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
wb.load("/home/timothymccallum/test.xlsx");
|
||||
auto ws = wb.active_sheet();
|
||||
std::clog << "Processing spread sheet" << std::endl;
|
||||
for (auto row : ws.rows(false))
|
||||
{
|
||||
for (auto cell : row)
|
||||
{
|
||||
std::clog << cell.to_string() << std::endl;
|
||||
}
|
||||
}
|
||||
std::clog << "Processing complete" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
Save the contents of the above file
|
||||
```
|
||||
/home/timothymccallum/process.cpp
|
||||
```
|
||||
Compile by typing the following command
|
||||
```
|
||||
g++ -std=c++14 -lxlnt process.cpp -o process
|
||||
```
|
||||
Excecute by typing the following command
|
||||
```
|
||||
./process
|
||||
```
|
||||
The output of the program, in my case, is as follows
|
||||
```
|
||||
Processing spread sheet
|
||||
This is cell A1.
|
||||
This is cell B1
|
||||
… and this is cell C1
|
||||
We are now on the second row at cell A2
|
||||
B2
|
||||
C2
|
||||
Processing complete
|
||||
```
|
||||
As you can see the process.cpp file simply walks through the spread sheet values row by row and column by column (A1, B1, C1, A2, B2, C2 and so on).
|
||||
|
||||
### Simple - storing a spread sheet in a 2 dimensional C++ Vector for further processing
|
||||
|
||||
Loading a spread sheet into a Vector provides oppourtunities for you to perform high performance processing. There will be more examples on performing fast look-ups, merging data, performing deduplication and more. For now, let's just learn how to get the spread sheet loaded into memory.
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
#include <vector>
|
||||
|
||||
int main()
|
||||
{
|
||||
xlnt::workbook wb;
|
||||
wb.load("/home/timothymccallum/test.xlsx");
|
||||
auto ws = wb.active_sheet();
|
||||
std::clog << "Processing spread sheet" << std::endl;
|
||||
std::clog << "Creating a single vector which stores the whole spread sheet" << std::endl;
|
||||
std::vector< std::vector<std::string> > theWholeSpreadSheet;
|
||||
for (auto row : ws.rows(false))
|
||||
{
|
||||
std::clog << "Creating a fresh vector for just this row in the spread sheet" << std::endl;
|
||||
std::vector<std::string> aSingleRow;
|
||||
for (auto cell : row)
|
||||
{
|
||||
std::clog << "Adding this cell to the row" << std::endl;
|
||||
aSingleRow.push_back(cell.to_string());
|
||||
}
|
||||
std::clog << "Adding this entire row to the vector which stores the whole spread sheet" << std::endl;
|
||||
theWholeSpreadSheet.push_back(aSingleRow);
|
||||
}
|
||||
std::clog << "Processing complete" << std::endl;
|
||||
std::clog << "Reading the vector and printing output to the screen" << std::endl;
|
||||
for (int rowInt = 0; rowInt < theWholeSpreadSheet.size(); rowInt++)
|
||||
{
|
||||
for (int colInt = 0; colInt < theWholeSpreadSheet.at(rowInt).size(); colInt++)
|
||||
{
|
||||
std::cout << theWholeSpreadSheet.at(rowInt).at(colInt) << std::endl;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
Save the contents of the above file
|
||||
```
|
||||
/home/timothymccallum/process.cpp
|
||||
```
|
||||
Compile by typing the following command
|
||||
```
|
||||
g++ -std=c++14 -lxlnt process.cpp -o process
|
||||
```
|
||||
Excecute by typing the following command
|
||||
```
|
||||
./process
|
||||
```
|
||||
The output of the program, in my case, is as follows
|
||||
```
|
||||
Processing spread sheet
|
||||
Creating a single vector which stores the whole spread sheet
|
||||
Creating a fresh vector for just this row in the spread sheet
|
||||
Adding this cell to the row
|
||||
Adding this cell to the row
|
||||
Adding this cell to the row
|
||||
Adding this entire row to the vector which stores the whole spread sheet
|
||||
Creating a fresh vector for just this row in the spread sheet
|
||||
Adding this cell to the row
|
||||
Adding this cell to the row
|
||||
Adding this cell to the row
|
||||
Adding this entire row to the vector which stores the whole spread sheet
|
||||
Processing complete
|
||||
Reading the vector and printing output to the screen
|
||||
This is cell A1.
|
||||
This is cell B1
|
||||
… and this is cell C1
|
||||
We are now on the second row at cell A2
|
||||
B2
|
||||
C2
|
||||
```
|
||||
You will have noticed that this process is very fast. If you type the "time" as shown below, you can measure just how fast loading and retrieving your spread sheet is, using xlnt; In this case only a fraction of a second. More on this later.
|
||||
```
|
||||
time ./process
|
||||
...
|
||||
real 0m0.044s
|
||||
```
|
||||
### Simple - writing values to a new xlsx spread sheet.
|
||||
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <xlnt/xlnt.hpp>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
int main()
|
||||
{
|
||||
//Creating a 2 dimensional vector which we will write values to
|
||||
std::vector< std::vector<std::string> > wholeWorksheet;
|
||||
//Looping through each row (100 rows as per the second argument in the for loop)
|
||||
for (int outer = 0; outer < 100; outer++)
|
||||
{
|
||||
//Creating a fresh vector for a fresh row
|
||||
std::vector<std::string> singleRow;
|
||||
//Looping through each of the columns (100 as per the second argument in the for loop) in this particular row
|
||||
for(int inner = 0; inner < 100; inner++)
|
||||
{
|
||||
//Adding a single value in each cell of the row
|
||||
std::string val = std::to_string(inner + 1);
|
||||
singleRow.push_back(val);
|
||||
}
|
||||
//Adding the single row to the 2 dimensional vector
|
||||
wholeWorksheet.push_back(singleRow);
|
||||
std::clog << "Writing to row " << outer << " in the vector " << std::endl;
|
||||
}
|
||||
//Writing to the spread sheet
|
||||
//Creating the output workbook
|
||||
std::clog << "Creating workbook" << std::endl;
|
||||
xlnt::workbook wbOut;
|
||||
//Setting the destination output file name
|
||||
std::string dest_filename = "output.xlsx";
|
||||
//Creating the output worksheet
|
||||
xlnt::worksheet wsOut = wbOut.active_sheet();
|
||||
//Giving the output worksheet a title/name
|
||||
wsOut.title("data");
|
||||
//We will now be looping through the 2 dimensional vector which we created above
|
||||
//In this case we have two iterators one for the outer loop (row) and one for the inner loop (column)
|
||||
std::clog << "Looping through vector and writing to spread sheet" << std::endl;
|
||||
for (int fOut = 0; fOut < wholeWorksheet.size(); fOut++)
|
||||
{
|
||||
std::clog << "Row" << fOut << std::endl;
|
||||
for (int fIn = 0; fIn < wholeWorksheet.at(fOut).size(); fIn++)
|
||||
{
|
||||
//Take notice of the difference between accessing the vector and accessing the work sheet
|
||||
//As you may already know Excel spread sheets start at row 1 and column 1 (not row 0 and column 0 like you would expect from a C++ vector)
|
||||
//In short the xlnt cell reference starts at column 1 row 1 (hence the + 1s below) and the vector reference starts at row 0 and column 0
|
||||
wsOut.cell(xlnt::cell_reference(fIn + 1, fOut + 1)).value(wholeWorksheet.at(fOut).at(fIn));
|
||||
//Further clarification to avoid confusion
|
||||
//Cell reference arguments are (column number, row number); e.g. cell_reference(fIn + 1, fOut + 1)
|
||||
//Vector arguments are (row number, column number); e.g. wholeWorksheet.at(fOut).at(fIn)
|
||||
}
|
||||
}
|
||||
std::clog << "Finished writing spread sheet" << std::endl;
|
||||
wbOut.save(dest_filename);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
This process is also quite quick; a time command showed that xlnt was able to create and write 10, 000 values to the output spread sheet in 0.582 seconds.
|
|
@ -0,0 +1,54 @@
|
|||
|
||||
## Features
|
||||
|
||||
| Feature | Read | Edit | Write |
|
||||
|---------------------------------------------------------------------|------|------|-------|
|
||||
| Excel-style Workbook | ✓ | ✓ | ✓ |
|
||||
| LibreOffice-style Workbook | ✓ | ✓ | ✓ |
|
||||
| Numbers-style Workbook | ✓ | ✓ | ✓ |
|
||||
| Encrypted Workbook (Excel 2007-2010) | ✓ | ✓ | |
|
||||
| Encrypted Workbook (Excel 2013-2016) | ✓ | ✓ | |
|
||||
| Excel Binary Workbook (.xlsb) | | | |
|
||||
| Excel Macro-Enabled Workbook (.xlsm) | | | |
|
||||
| Excel Macro-Enabled Template (.xltm) | | | |
|
||||
| Document Properties | ✓ | ✓ | ✓ |
|
||||
| Numeric Cell Values | ✓ | ✓ | ✓ |
|
||||
| Inline String Cell Values | ✓ | ✓ | ✓ |
|
||||
| Shared String Cell Values | ✓ | ✓ | ✓ |
|
||||
| Shared String Text Run Formatting (e.g. varied fonts within a cell) | ✓ | ✓ | ✓ |
|
||||
| Hyperlink Cell Values | | | |
|
||||
| Formula Cell Values | | | |
|
||||
| Formula Evaluation | | | |
|
||||
| Page Margins | ✓ | ✓ | ✓ |
|
||||
| Page Setup | | | |
|
||||
| Print Area | | | |
|
||||
| Comments | ✓ | ✓ | |
|
||||
| Header and Footer | | | |
|
||||
| Custom Views | | | |
|
||||
| Charts | | | |
|
||||
| Chartsheets | | | |
|
||||
| Dialogsheets | | | |
|
||||
| Themes | ✓ | | ✓ |
|
||||
| Cell Styles | ✓ | ✓ | ✓ |
|
||||
| Cell Formats | ✓ | ✓ | ✓ |
|
||||
| Formatting->Alignment (e.g. right align) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Border (e.g. red cell outline) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Fill (e.g. green cell background) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Font (e.g. blue cell text) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Number Format (e.g. show 2 decimals) | ✓ | ✓ | ✓ |
|
||||
| Formatting->Protection (e.g. hide formulas) | ✓ | ✓ | ✓ |
|
||||
| Column Styles | | | |
|
||||
| Row Styles | | | |
|
||||
| Sheet Styles | | | |
|
||||
| Conditional Formatting | | | |
|
||||
| Tables | | | |
|
||||
| Table Formatting | | | |
|
||||
| Pivot Tables | | | |
|
||||
| XLSX Thumbnail | ✓ | | ✓ |
|
||||
| Custom OOXML Properties | | | |
|
||||
| Custom OOXML Parts | | | |
|
||||
| Drawing | | | |
|
||||
| Text Box | | | |
|
||||
| WordArt | | | |
|
||||
| Embedded Content (e.g. images) | | | |
|
||||
| Excel VBA | | | |
|
|
@ -0,0 +1,79 @@
|
|||
# Getting xlnt
|
||||
|
||||
## Binaries
|
||||
|
||||
## Homebrew
|
||||
|
||||
## Arch
|
||||
|
||||
xlnt can be [found](https://aur.archlinux.org/packages/xlnt/) on the AUR.
|
||||
|
||||
## vcpkg
|
||||
`vcpkg` installs x86 by default
|
||||
```
|
||||
.\vcpkg install xlnt
|
||||
```
|
||||
if you need x64 use the following command
|
||||
```
|
||||
.\vcpkg install xlnt:x64-windows
|
||||
```
|
||||
|
||||
## Compiling xlnt 1.x.x from Source on Ubuntu 16.04 LTS (Xenial Xerus)
|
||||
Time required: Approximately 5 minutes (depending on your internet speed)
|
||||
```
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get install cmake
|
||||
sudo apt-get install zlibc
|
||||
```
|
||||
The following steps update the compiler and set the appropriate environment variables - see note [1] below for the reason why we need to update the standard available compiler
|
||||
```
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
sudo apt update
|
||||
sudo apt-get upgrade
|
||||
sudo apt-get install gcc-6 g++-6
|
||||
export CC=/usr/bin/gcc-6
|
||||
export CXX=/usr/bin/g++-6
|
||||
```
|
||||
The following steps will intall xlnt
|
||||
```
|
||||
git clone https://github.com/tfussell/xlnt.git xlnt --recurse-submodules
|
||||
cd xlnt
|
||||
cmake .
|
||||
make -j 2
|
||||
sudo make install
|
||||
```
|
||||
The following step will map the shared library names to the location of the corresponding shared library files
|
||||
```
|
||||
sudo ldconfig
|
||||
```
|
||||
xlnt will now be ready to use on your Ubuntu instance.
|
||||
|
||||
[1]
|
||||
Xlnt requires a minimum of gcc 6.2.0
|
||||
The most recent gcc version available using the standard APT repositories is gcc 5.4.0 (obtained through build-essential 12.1ubuntu2). If these older versions of gcc are used an error "workbook.cpp error 1502:31 'extended_property' is not a class, namespace or enumeration" will occur during the xlnt make command.
|
||||
|
||||
## Compiling from Source
|
||||
|
||||
Build configurations for Visual Studio, GNU Make, Ninja, and Xcode can be created using [cmake](https://cmake.org/) v3.2+. A full list of cmake generators can be found [here](https://cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html). A basic build would look like (starting in the root xlnt directory):
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j8
|
||||
```
|
||||
|
||||
The resulting shared (e.g. libxlnt.dylib) library would be found in the build/lib directory. Other cmake configuration options for xlnt can be found using "cmake -LH". These options include building a static library instead of shared and whether to build sample executables or not. An example of building a static library with an Xcode project:
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -D STATIC=ON -G Xcode ..
|
||||
cmake --build .
|
||||
cd bin && ./xlnt.test
|
||||
```
|
||||
*Note for Windows: cmake defaults to building a 32-bit library project. To build a 64-bit library, use the Win64 generator*
|
||||
```bash
|
||||
cmake -G "Visual Studio 14 2015 Win64" ..
|
||||
```
|
|
@ -0,0 +1 @@
|
|||
## Motivation
|
|
@ -0,0 +1,6 @@
|
|||
## Introduction
|
||||
|
||||
* [Motivation](Motivation.md)
|
||||
* [Examples](Examples.md)
|
||||
* [Features](Features.md)
|
||||
* [Installation](Installation.md)
|
263
docs/make.bat
263
docs/make.bat
|
@ -1,263 +0,0 @@
|
|||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. xml to make Docutils-native XML files
|
||||
echo. pseudoxml to make pseudoxml-XML files for display purposes
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
echo. coverage to run coverage check of the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
|
||||
REM Check if sphinx-build is available and fallback to Python version if any
|
||||
%SPHINXBUILD% 2> nul
|
||||
if errorlevel 9009 goto sphinx_python
|
||||
goto sphinx_ok
|
||||
|
||||
:sphinx_python
|
||||
|
||||
set SPHINXBUILD=python -m sphinx.__init__
|
||||
%SPHINXBUILD% 2> nul
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||
echo.may add the Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.http://sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:sphinx_ok
|
||||
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\xlnt.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\xlnt.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latexpdf" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
cd %BUILDDIR%/latex
|
||||
make all-pdf
|
||||
cd %~dp0
|
||||
echo.
|
||||
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latexpdfja" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
cd %BUILDDIR%/latex
|
||||
make all-pdf-ja
|
||||
cd %~dp0
|
||||
echo.
|
||||
echo.Build finished; the PDF files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "coverage" (
|
||||
%SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of coverage in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/coverage/python.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "xml" (
|
||||
%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The XML files are in %BUILDDIR%/xml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pseudoxml" (
|
||||
%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
|
@ -1 +0,0 @@
|
|||
breathe
|
|
@ -1,17 +0,0 @@
|
|||
Working with styles
|
||||
===================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Styles are used to change the look of your data while displayed on screen.
|
||||
They are also used to determine the number format being used for a given cell
|
||||
or range of cells.
|
||||
|
||||
Styles can be applied to the following aspects:
|
||||
|
||||
* font to set font size, color, underlining, etc.
|
||||
* fill to set a pattern or color gradient
|
||||
* border to set borders on a cell
|
||||
* cell alignment
|
||||
* protection
|
|
@ -0,0 +1,3 @@
|
|||
<% for(var i = 0; i < summary.length; i++) {%>
|
||||
<%- summary[i].content %>
|
||||
<% } %>
|
|
@ -0,0 +1,100 @@
|
|||
var xpath = require('xpath');
|
||||
var dom = require('xmldom').DOMParser;
|
||||
var fs = require('fs');
|
||||
var _ = require('underscore');
|
||||
var async = require('async');
|
||||
|
||||
function generate(directory, primary_callback) {
|
||||
var modules = [];
|
||||
return fs.readFile(directory + 'index.xml', 'utf8', (err, xml) => {
|
||||
if (err) throw err;
|
||||
var doc = new dom().parseFromString(xml);
|
||||
var nodes = xpath.select('/doxygenindex/compound[@kind="dir"]', doc);
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var refid = nodes[i].getAttribute('refid');
|
||||
var name = nodes[i].firstChild.firstChild.toString();
|
||||
modules.push({name: name, refid: refid});
|
||||
}
|
||||
const root_module = _.find(modules, (module) => {
|
||||
return _.last(module.name.split('/')) == 'xlnt';
|
||||
});
|
||||
const root_name = root_module.name;
|
||||
modules = _.filter(modules, (module) => {
|
||||
return module.name.indexOf(root_name) >= 0 && module.name !== root_name;
|
||||
});
|
||||
return async.mapSeries(modules, (module, module_callback) => {
|
||||
return fs.readFile(directory + module.refid + '.xml', 'utf8', (err, xml) => {
|
||||
if (err) throw err;
|
||||
var doc = new dom().parseFromString(xml);
|
||||
var nodes = xpath.select('/doxygen/compounddef/innerfile', doc);
|
||||
module.source_files = [];
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var refid = nodes[i].getAttribute('refid');
|
||||
var name = nodes[i].firstChild.toString();
|
||||
module.source_files.push({name: name, refid: refid});
|
||||
}
|
||||
return async.map(module.source_files, (source_file, source_file_callback) => {
|
||||
return fs.readFile(directory + source_file.refid + '.xml', 'utf8', (err, xml) => {
|
||||
if (err) throw err;
|
||||
var doc = new dom().parseFromString(xml);
|
||||
var nodes = xpath.select('/doxygen/compounddef/innerclass', doc);
|
||||
module.class_files = [];
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var refid = nodes[i].getAttribute('refid');
|
||||
var name = nodes[i].firstChild.toString();
|
||||
module.class_files.push({name: name, refid: refid});
|
||||
}
|
||||
return async.map(module.class_files, (class_file, class_file_callback) => {
|
||||
return fs.readFile(directory + class_file.refid + '.xml', 'utf8', (err, xml) => {
|
||||
if (err) throw err;
|
||||
var doc = new dom().parseFromString(xml);
|
||||
var nodes = xpath.select('/doxygen/compounddef/sectiondef/memberdef[@prot="public"]', doc);
|
||||
var members = [];
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var member_data = {id: nodes[i].getAttribute('id')};
|
||||
var child = nodes[i].firstChild;
|
||||
while (child != nodes[i].lastChild) {
|
||||
if (child.textContent.trim()) {
|
||||
member_data[child.nodeName] = child.textContent.trim();
|
||||
}
|
||||
child = child.nextSibling;
|
||||
}
|
||||
members.push(member_data);
|
||||
}
|
||||
class_file.members = members;
|
||||
return class_file_callback(null, class_file);
|
||||
});
|
||||
}, (err, data) => {
|
||||
return source_file_callback(null, _.flatten(data, true));
|
||||
});
|
||||
});
|
||||
}, (err, data) => {
|
||||
module.classes = _.flatten(data, true);
|
||||
return module_callback(null, module);
|
||||
});
|
||||
});
|
||||
}, (err, data) => {
|
||||
return primary_callback(null, _.flatten(data, true));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
generate('doxyxml/', function(err, data) {
|
||||
console.log('# API Reference');
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var module = data[i];
|
||||
var module_name = _.last(module.name.split('/'));
|
||||
console.log('##', module_name.charAt(0).toUpperCase() + module_name.slice(1), 'Module');
|
||||
for (var j = 0; j < module.classes.length; j++) {
|
||||
var class_ = module.classes[j];
|
||||
console.log('###', _.last(class_.name.split('::')));
|
||||
for (var k = 0; k < class_.members.length; k++) {
|
||||
var member = class_.members[k];
|
||||
console.log('####', '```' + member.definition + member.argsstring + '```');
|
||||
if (member.briefdescription) {
|
||||
console.log(member.briefdescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,5 +0,0 @@
|
|||
Manipulating a workbook in memory
|
||||
=================================
|
||||
|
||||
Create a workbook
|
||||
-----------------
|
|
@ -1,2 +0,0 @@
|
|||
Validating cells
|
||||
================
|
|
@ -1,2 +0,0 @@
|
|||
Testing on Windows
|
||||
==================
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -31,6 +31,7 @@
|
|||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/cell/cell_type.hpp>
|
||||
#include <xlnt/cell/index_types.hpp>
|
||||
#include <xlnt/cell/rich_text.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
@ -46,11 +47,14 @@ class font;
|
|||
class format;
|
||||
class number_format;
|
||||
class protection;
|
||||
class range;
|
||||
class relationship;
|
||||
class style;
|
||||
class workbook;
|
||||
class worksheet;
|
||||
class xlsx_consumer;
|
||||
class xlsx_producer;
|
||||
class phonetic_pr;
|
||||
|
||||
struct date;
|
||||
struct datetime;
|
||||
|
@ -67,7 +71,8 @@ struct cell_impl;
|
|||
} // namespace detail
|
||||
|
||||
/// <summary>
|
||||
/// Describes cell associated properties.
|
||||
/// Describes a unit of data in a worksheet at a specific coordinate and its
|
||||
/// associated properties.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Properties of interest include style, type, value, and address.
|
||||
|
@ -84,7 +89,7 @@ public:
|
|||
using type = cell_type;
|
||||
|
||||
/// <summary>
|
||||
/// Return a map of error strings such as \#DIV/0! and their associated indices.
|
||||
/// Returns a map of error strings such as \#DIV/0! and their associated indices.
|
||||
/// </summary>
|
||||
static const std::unordered_map<std::string, int> &error_codes();
|
||||
|
||||
|
@ -96,12 +101,12 @@ public:
|
|||
// value
|
||||
|
||||
/// <summary>
|
||||
/// Return true if value has been set and has not been cleared using cell::clear_value().
|
||||
/// Returns true if value has been set and has not been cleared using cell::clear_value().
|
||||
/// </summary>
|
||||
bool has_value() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the value of this cell as an instance of type T.
|
||||
/// Returns the value of this cell as an instance of type T.
|
||||
/// Overloads exist for most C++ fundamental types like bool, int, etc. as well
|
||||
/// as for std::string and xlnt datetime types: date, time, datetime, and timedelta.
|
||||
/// </summary>
|
||||
|
@ -109,32 +114,105 @@ public:
|
|||
T value() const;
|
||||
|
||||
/// <summary>
|
||||
/// Make this cell have a value of type null.
|
||||
/// Makes this cell have a value of type null.
|
||||
/// All other cell attributes are retained.
|
||||
/// </summary>
|
||||
void clear_value();
|
||||
|
||||
/// <summary>
|
||||
/// Set the value of this cell to the given value.
|
||||
/// Overloads exist for most C++ fundamental types like bool, int, etc. as well
|
||||
/// as for std::string and xlnt datetime types: date, time, datetime, and timedelta.
|
||||
/// Sets the type of this cell to null.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
void value(T value);
|
||||
void value(std::nullptr_t);
|
||||
|
||||
/// <summary>
|
||||
/// Analyze string_value to determine its type, convert it to that type,
|
||||
/// Sets the value of this cell to the given boolean value.
|
||||
/// </summary>
|
||||
void value(bool boolean_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(int int_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(unsigned int int_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(long long int int_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(unsigned long long int int_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(float float_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(double float_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(const date &date_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(const time &time_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(const datetime &datetime_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(const timedelta &timedelta_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(const std::string &string_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(const char *string_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of this cell to the given value.
|
||||
/// </summary>
|
||||
void value(const rich_text &text_value);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value and formatting of this cell to that of other_cell.
|
||||
/// </summary>
|
||||
void value(const cell other_cell);
|
||||
|
||||
/// <summary>
|
||||
/// Analyzes string_value to determine its type, convert it to that type,
|
||||
/// and set the value of this cell to that converted value.
|
||||
/// </summary>
|
||||
void value(const std::string &string_value, bool infer_type);
|
||||
|
||||
/// <summary>
|
||||
/// Return the type of this cell.
|
||||
/// Returns the type of this cell.
|
||||
/// </summary>
|
||||
type data_type() const;
|
||||
|
||||
/// <summary>
|
||||
/// Set the type of this cell.
|
||||
/// Sets the type of this cell. This should usually be done indirectly
|
||||
/// by setting the value of the cell to a value of that type.
|
||||
/// </summary>
|
||||
void data_type(type t);
|
||||
|
||||
|
@ -142,96 +220,124 @@ public:
|
|||
|
||||
/// <summary>
|
||||
/// There's no reason to keep a cell which has no value and is not a placeholder.
|
||||
/// Return true if this cell has no value, style, isn't merged, etc.
|
||||
/// Returns true if this cell has no value, style, isn't merged, etc.
|
||||
/// </summary>
|
||||
bool garbage_collectible() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true iff this cell's number format matches a date format.
|
||||
/// Returns true iff this cell's number format matches a date format.
|
||||
/// </summary>
|
||||
bool is_date() const;
|
||||
|
||||
// position
|
||||
|
||||
/// <summary>
|
||||
/// Return a cell_reference that points to the location of this cell.
|
||||
/// Returns a cell_reference that points to the location of this cell.
|
||||
/// </summary>
|
||||
cell_reference reference() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the column of this cell.
|
||||
/// Returns the column of this cell.
|
||||
/// </summary>
|
||||
column_t column() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the row of this cell.
|
||||
/// Returns the numeric index (A == 1) of the column of this cell.
|
||||
/// </summary>
|
||||
column_t::index_t column_index() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the row of this cell.
|
||||
/// </summary>
|
||||
row_t row() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the location of this cell as an ordered pair.
|
||||
/// Returns the location of this cell as an ordered pair (left, top).
|
||||
/// </summary>
|
||||
std::pair<int, int> anchor() const;
|
||||
|
||||
// hyperlink
|
||||
|
||||
/// <summary>
|
||||
/// Return the URL of this cell's hyperlink.
|
||||
/// Returns the relationship of this cell's hyperlink.
|
||||
/// </summary>
|
||||
std::string hyperlink() const;
|
||||
class hyperlink hyperlink() const;
|
||||
|
||||
/// <summary>
|
||||
/// Add a hyperlink to this cell pointing to the URI of the given value.
|
||||
/// Adds a hyperlink to this cell pointing to the URI of the given value and sets
|
||||
/// the text value of the cell to the given parameter.
|
||||
/// </summary>
|
||||
void hyperlink(const std::string &value);
|
||||
void hyperlink(const std::string &url, const std::string &display = "");
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this cell has a hyperlink set.
|
||||
/// Adds an internal hyperlink to this cell pointing to the given cell.
|
||||
/// </summary>
|
||||
void hyperlink(xlnt::cell target, const std::string &display = "");
|
||||
|
||||
/// <summary>
|
||||
/// Adds an internal hyperlink to this cell pointing to the given range.
|
||||
/// </summary>
|
||||
void hyperlink(xlnt::range target, const std::string &display = "");
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this cell has a hyperlink set.
|
||||
/// </summary>
|
||||
bool has_hyperlink() const;
|
||||
|
||||
// computed formatting
|
||||
|
||||
/// <summary>
|
||||
/// Returns the result of computed_format().alignment().
|
||||
/// Returns the alignment that should be used when displaying this cell
|
||||
/// graphically based on the workbook default, the cell-level format,
|
||||
/// and the named style applied to the cell in that order.
|
||||
/// </summary>
|
||||
class alignment computed_alignment() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the result of computed_format().border().
|
||||
/// Returns the border that should be used when displaying this cell
|
||||
/// graphically based on the workbook default, the cell-level format,
|
||||
/// and the named style applied to the cell in that order.
|
||||
/// </summary>
|
||||
class border computed_border() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the result of computed_format().fill().
|
||||
/// Returns the fill that should be used when displaying this cell
|
||||
/// graphically based on the workbook default, the cell-level format,
|
||||
/// and the named style applied to the cell in that order.
|
||||
/// </summary>
|
||||
class fill computed_fill() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the result of computed_format().font().
|
||||
/// Returns the font that should be used when displaying this cell
|
||||
/// graphically based on the workbook default, the cell-level format,
|
||||
/// and the named style applied to the cell in that order.
|
||||
/// </summary>
|
||||
class font computed_font() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the result of computed_format().number_format().
|
||||
/// Returns the number format that should be used when displaying this cell
|
||||
/// graphically based on the workbook default, the cell-level format,
|
||||
/// and the named style applied to the cell in that order.
|
||||
/// </summary>
|
||||
class number_format computed_number_format() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the result of computed_format().protection().
|
||||
/// Returns the protection that should be used when displaying this cell
|
||||
/// graphically based on the workbook default, the cell-level format,
|
||||
/// and the named style applied to the cell in that order.
|
||||
/// </summary>
|
||||
class protection computed_protection() const;
|
||||
|
||||
// format
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this cell has had a format applied to it.
|
||||
/// Returns true if this cell has had a format applied to it.
|
||||
/// </summary>
|
||||
bool has_format() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return a reference to the format applied to this cell.
|
||||
/// If this cell has no format, an invalid_attribute exception will be thrown.
|
||||
/// Returns the format applied to this cell. If this cell has no
|
||||
/// format, an invalid_attribute exception will be thrown.
|
||||
/// </summary>
|
||||
const class format format() const;
|
||||
|
||||
|
@ -241,7 +347,7 @@ public:
|
|||
void format(const class format new_format);
|
||||
|
||||
/// <summary>
|
||||
/// Remove the cell-level formatting from this cell.
|
||||
/// Removes the cell-level formatting from this cell.
|
||||
/// This doesn't affect the style that may also be applied to the cell.
|
||||
/// Throws an invalid_attribute exception if no format is applied.
|
||||
/// </summary>
|
||||
|
@ -320,13 +426,19 @@ public:
|
|||
/// </summary>
|
||||
bool has_style() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns a wrapper pointing to the named style applied to this cell.
|
||||
/// </summary>
|
||||
class style style();
|
||||
|
||||
/// <summary>
|
||||
/// Returns a wrapper pointing to the named style applied to this cell.
|
||||
/// </summary>
|
||||
const class style style() const;
|
||||
|
||||
/// <summary>
|
||||
/// Equivalent to style(new_style.name())
|
||||
/// Sets the named style applied to this cell to a style named style_name.
|
||||
/// Equivalent to style(new_style.name()).
|
||||
/// </summary>
|
||||
void style(const class style &new_style);
|
||||
|
||||
|
@ -378,120 +490,142 @@ public:
|
|||
// merging
|
||||
|
||||
/// <summary>
|
||||
/// Return true iff this cell has been merged with one or more
|
||||
/// Returns true iff this cell has been merged with one or more
|
||||
/// surrounding cells.
|
||||
/// </summary>
|
||||
bool is_merged() const;
|
||||
|
||||
/// <summary>
|
||||
/// Make this a merged cell iff merged is true.
|
||||
/// Makes this a merged cell iff merged is true.
|
||||
/// Generally, this shouldn't be called directly. Instead,
|
||||
/// use worksheet::merge_cells on its parent worksheet.
|
||||
/// </summary>
|
||||
void merged(bool merged);
|
||||
|
||||
// phonetics
|
||||
|
||||
/// <summary>
|
||||
/// Return the error string that is stored in this cell.
|
||||
/// Returns true if this cell is set to show phonetic information.
|
||||
/// </summary>
|
||||
bool phonetics_visible() const;
|
||||
|
||||
/// <summary>
|
||||
/// Enables the display of phonetic information on this cell.
|
||||
/// </summary>
|
||||
void show_phonetics(bool phonetics);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the error string that is stored in this cell.
|
||||
/// </summary>
|
||||
std::string error() const;
|
||||
|
||||
/// <summary>
|
||||
/// Directly assign the value of this cell to be the given error.
|
||||
/// Directly assigns the value of this cell to be the given error.
|
||||
/// </summary>
|
||||
void error(const std::string &error);
|
||||
|
||||
/// <summary>
|
||||
/// Return a cell from this cell's parent workbook at
|
||||
/// Returns a cell from this cell's parent workbook at
|
||||
/// a relative offset given by the parameters.
|
||||
/// </summary>
|
||||
cell offset(int column, int row);
|
||||
|
||||
/// <summary>
|
||||
/// Return the worksheet that owns this cell.
|
||||
/// Returns the worksheet that owns this cell.
|
||||
/// </summary>
|
||||
class worksheet worksheet();
|
||||
|
||||
/// <summary>
|
||||
/// Return the worksheet that owns this cell.
|
||||
/// Returns the worksheet that owns this cell.
|
||||
/// </summary>
|
||||
const class worksheet worksheet() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the workbook of the worksheet that owns this cell.
|
||||
/// Returns the workbook of the worksheet that owns this cell.
|
||||
/// </summary>
|
||||
class workbook &workbook();
|
||||
|
||||
/// <summary>
|
||||
/// Return the workbook of the worksheet that owns this cell.
|
||||
/// Returns the workbook of the worksheet that owns this cell.
|
||||
/// </summary>
|
||||
const class workbook &workbook() const;
|
||||
|
||||
/// <summary>
|
||||
/// Shortcut to return the base date of the parent workbook.
|
||||
/// Equivalent to workbook().properties().excel_base_date
|
||||
/// Returns the base date of the parent workbook.
|
||||
/// </summary>
|
||||
calendar base_date() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return to_check after checking encoding, size, and illegal characters.
|
||||
/// Returns to_check after verifying and fixing encoding, size, and illegal characters.
|
||||
/// </summary>
|
||||
std::string check_string(const std::string &to_check);
|
||||
|
||||
// comment
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this cell has a comment applied.
|
||||
/// Returns true if this cell has a comment applied.
|
||||
/// </summary>
|
||||
bool has_comment();
|
||||
|
||||
/// <summary>
|
||||
/// Delete the comment applied to this cell if it exists.
|
||||
/// Deletes the comment applied to this cell if it exists.
|
||||
/// </summary>
|
||||
void clear_comment();
|
||||
|
||||
/// <summary>
|
||||
/// Get the comment applied to this cell.
|
||||
/// Gets the comment applied to this cell.
|
||||
/// </summary>
|
||||
class comment comment();
|
||||
|
||||
/// <summary>
|
||||
/// Create a new comment with the given text and optional author and apply it to the cell.
|
||||
/// Creates a new comment with the given text and optional author and
|
||||
/// applies it to the cell.
|
||||
/// </summary>
|
||||
void comment(const std::string &text, const std::string &author = "Microsoft Office User");
|
||||
void comment(const std::string &text,
|
||||
const std::string &author = "Microsoft Office User");
|
||||
|
||||
/// <summary>
|
||||
/// Create a new comment with the given text, formatting, and optional author and apply it to the cell.
|
||||
/// Creates a new comment with the given text, formatting, and optional
|
||||
/// author and applies it to the cell.
|
||||
/// </summary>
|
||||
void comment(const std::string &comment_text, const class font &comment_font, const std::string &author = "Microsoft Office User");
|
||||
void comment(const std::string &comment_text,
|
||||
const class font &comment_font,
|
||||
const std::string &author = "Microsoft Office User");
|
||||
|
||||
/// <summary>
|
||||
/// Apply the comment provided as the only argument to the cell.
|
||||
/// </summary>
|
||||
void comment(const class comment &new_comment);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the width of this cell in pixels.
|
||||
/// </summary>
|
||||
double width() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the height of this cell in pixels.
|
||||
/// </summary>
|
||||
double height() const;
|
||||
|
||||
// operators
|
||||
|
||||
/// <summary>
|
||||
/// Make this cell point to rhs.
|
||||
/// The cell originally pointed to by this cell will be unchanged.
|
||||
/// Makes this cell interally point to rhs.
|
||||
/// The cell data originally pointed to by this cell will be unchanged.
|
||||
/// </summary>
|
||||
cell &operator=(const cell &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this cell the same cell as comparand (compare by reference).
|
||||
/// Returns true if this cell the same cell as comparand (compared by reference).
|
||||
/// </summary>
|
||||
bool operator==(const cell &comparand) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this cell is uninitialized.
|
||||
/// Returns false if this cell the same cell as comparand (compared by reference).
|
||||
/// </summary>
|
||||
bool operator==(std::nullptr_t) const;
|
||||
bool operator!=(const cell &comparand) const;
|
||||
|
||||
private:
|
||||
// make these friends so they can use the private constructor
|
||||
friend class style;
|
||||
friend class worksheet;
|
||||
friend class detail::xlsx_consumer;
|
||||
|
@ -505,7 +639,7 @@ private:
|
|||
class format modifiable_format();
|
||||
|
||||
/// <summary>
|
||||
/// Delete default zero-argument constructor.
|
||||
/// Delete the default zero-argument constructor.
|
||||
/// </summary>
|
||||
cell() = delete;
|
||||
|
||||
|
@ -521,14 +655,58 @@ private:
|
|||
};
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this cell is uninitialized.
|
||||
/// Returns true if this cell is uninitialized.
|
||||
/// </summary>
|
||||
XLNT_API bool operator==(std::nullptr_t, const cell &cell);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this cell is uninitialized.
|
||||
/// </summary>
|
||||
XLNT_API bool operator==(const cell &cell, std::nullptr_t);
|
||||
|
||||
/// <summary>
|
||||
/// Convenience function for writing cell to an ostream.
|
||||
/// Uses cell::to_string() internally.
|
||||
/// </summary>
|
||||
XLNT_API std::ostream &operator<<(std::ostream &stream, const xlnt::cell &cell);
|
||||
|
||||
template <>
|
||||
bool cell::value<bool>() const;
|
||||
|
||||
template <>
|
||||
int cell::value<int>() const;
|
||||
|
||||
template <>
|
||||
unsigned int cell::value<unsigned int>() const;
|
||||
|
||||
template <>
|
||||
long long int cell::value<long long int>() const;
|
||||
|
||||
template <>
|
||||
unsigned long long cell::value<unsigned long long int>() const;
|
||||
|
||||
template <>
|
||||
float cell::value<float>() const;
|
||||
|
||||
template <>
|
||||
double cell::value<double>() const;
|
||||
|
||||
template <>
|
||||
date cell::value<date>() const;
|
||||
|
||||
template <>
|
||||
time cell::value<time>() const;
|
||||
|
||||
template <>
|
||||
datetime cell::value<datetime>() const;
|
||||
|
||||
template <>
|
||||
timedelta cell::value<timedelta>() const;
|
||||
|
||||
template <>
|
||||
std::string cell::value<std::string>() const;
|
||||
|
||||
template <>
|
||||
rich_text cell::value<rich_text>() const;
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -23,13 +23,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/cell/index_types.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class cell_reference;
|
||||
|
@ -42,7 +44,7 @@ class range_reference;
|
|||
struct XLNT_API cell_reference_hash
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a hash representing a particular cell_reference.
|
||||
/// </summary>
|
||||
std::size_t operator()(const cell_reference &k) const;
|
||||
};
|
||||
|
@ -58,12 +60,12 @@ class XLNT_API cell_reference
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
/// Split a coordinate string like "A1" into an equivalent pair like {"A", 1}.
|
||||
/// Splits a coordinate string like "A1" into an equivalent pair like {"A", 1}.
|
||||
/// </summary>
|
||||
static std::pair<std::string, row_t> split_reference(const std::string &reference_string);
|
||||
|
||||
/// <summary>
|
||||
/// Split a coordinate string like "A1" into an equivalent pair like {"A", 1}.
|
||||
/// Splits a coordinate string like "A1" into an equivalent pair like {"A", 1}.
|
||||
/// Reference parameters absolute_column and absolute_row will be set to true
|
||||
/// if column part or row part are prefixed by a dollar-sign indicating they
|
||||
/// are absolute, otherwise false.
|
||||
|
@ -98,7 +100,7 @@ public:
|
|||
// absoluteness
|
||||
|
||||
/// <summary>
|
||||
/// Convert a coordinate to an absolute coordinate string (e.g. B12 -> $B$12)
|
||||
/// Converts a coordinate to an absolute coordinate string (e.g. B12 -> $B$12)
|
||||
/// Defaulting to true, absolute_column and absolute_row can optionally control
|
||||
/// whether the resulting cell_reference has an absolute column (e.g. B12 -> $B12)
|
||||
/// and absolute row (e.g. B12 -> B$12) respectively.
|
||||
|
@ -113,23 +115,23 @@ public:
|
|||
cell_reference &make_absolute(bool absolute_column = true, bool absolute_row = true);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the reference refers to an absolute column, otherwise false.
|
||||
/// Returns true if the reference refers to an absolute column, otherwise false.
|
||||
/// </summary>
|
||||
bool column_absolute() const;
|
||||
|
||||
/// <summary>
|
||||
/// Make this reference have an absolute column if absolute_column is true,
|
||||
/// Makes this reference have an absolute column if absolute_column is true,
|
||||
/// otherwise not absolute.
|
||||
/// </summary>
|
||||
void column_absolute(bool absolute_column);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the reference refers to an absolute row, otherwise false.
|
||||
/// Returns true if the reference refers to an absolute row, otherwise false.
|
||||
/// </summary>
|
||||
bool row_absolute() const;
|
||||
|
||||
/// <summary>
|
||||
/// Make this reference have an absolute row if absolute_row is true,
|
||||
/// Makes this reference have an absolute row if absolute_row is true,
|
||||
/// otherwise not absolute.
|
||||
/// </summary>
|
||||
void row_absolute(bool absolute_row);
|
||||
|
@ -137,38 +139,38 @@ public:
|
|||
// getters/setters
|
||||
|
||||
/// <summary>
|
||||
/// Return a string that identifies the column of this reference
|
||||
/// Returns a string that identifies the column of this reference
|
||||
/// (e.g. second column from left is "B")
|
||||
/// </summary>
|
||||
column_t column() const;
|
||||
|
||||
/// <summary>
|
||||
/// Set the column of this reference from a string that identifies a particular column.
|
||||
/// Sets the column of this reference from a string that identifies a particular column.
|
||||
/// </summary>
|
||||
void column(const std::string &column_string);
|
||||
|
||||
/// <summary>
|
||||
/// Return a 1-indexed numeric index of the column of this reference.
|
||||
/// Returns a 1-indexed numeric index of the column of this reference.
|
||||
/// </summary>
|
||||
column_t::index_t column_index() const;
|
||||
|
||||
/// <summary>
|
||||
/// Set the column of this reference from a 1-indexed number that identifies a particular column.
|
||||
/// Sets the column of this reference from a 1-indexed number that identifies a particular column.
|
||||
/// </summary>
|
||||
void column_index(column_t column);
|
||||
|
||||
/// <summary>
|
||||
/// Return a 1-indexed numeric index of the row of this reference.
|
||||
/// Returns a 1-indexed numeric index of the row of this reference.
|
||||
/// </summary>
|
||||
row_t row() const;
|
||||
|
||||
/// <summary>
|
||||
/// Set the row of this reference from a 1-indexed number that identifies a particular row.
|
||||
/// Sets the row of this reference from a 1-indexed number that identifies a particular row.
|
||||
/// </summary>
|
||||
void row(row_t row);
|
||||
|
||||
/// <summary>
|
||||
/// Return a cell_reference offset from this cell_reference by
|
||||
/// Returns a cell_reference offset from this cell_reference by
|
||||
/// the number of columns and rows specified by the parameters.
|
||||
/// A negative value for column_offset or row_offset results
|
||||
/// in a reference above or left of this cell_reference, respectively.
|
||||
|
@ -176,12 +178,12 @@ public:
|
|||
cell_reference make_offset(int column_offset, int row_offset) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return a string like "A1" for cell_reference(1, 1).
|
||||
/// Returns a string like "A1" for cell_reference(1, 1).
|
||||
/// </summary>
|
||||
std::string to_string() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return a 1x1 range_reference containing only this cell_reference.
|
||||
/// Returns a 1x1 range_reference containing only this cell_reference.
|
||||
/// </summary>
|
||||
range_reference to_range() const;
|
||||
|
||||
|
@ -195,37 +197,37 @@ public:
|
|||
range_reference operator,(const cell_reference &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this reference is identical to comparand including
|
||||
/// Returns true if this reference is identical to comparand including
|
||||
/// in absoluteness of column and row.
|
||||
/// </summary>
|
||||
bool operator==(const cell_reference &comparand) const;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a cell_reference from reference_string and return the result
|
||||
/// Constructs a cell_reference from reference_string and return the result
|
||||
/// of their comparison.
|
||||
/// </summary>
|
||||
bool operator==(const std::string &reference_string) const;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a cell_reference from reference_string and return the result
|
||||
/// Constructs a cell_reference from reference_string and return the result
|
||||
/// of their comparison.
|
||||
/// </summary>
|
||||
bool operator==(const char *reference_string) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this reference is not identical to comparand including
|
||||
/// Returns true if this reference is not identical to comparand including
|
||||
/// in absoluteness of column and row.
|
||||
/// </summary>
|
||||
bool operator!=(const cell_reference &comparand) const;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a cell_reference from reference_string and return the result
|
||||
/// Constructs a cell_reference from reference_string and return the result
|
||||
/// of their comparison.
|
||||
/// </summary>
|
||||
bool operator!=(const std::string &reference_string) const;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a cell_reference from reference_string and return the result
|
||||
/// Constructs a cell_reference from reference_string and return the result
|
||||
/// of their comparison.
|
||||
/// </summary>
|
||||
bool operator!=(const char *reference_string) const;
|
||||
|
@ -255,3 +257,16 @@ private:
|
|||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<xlnt::cell_reference>
|
||||
{
|
||||
size_t operator()(const xlnt::cell_reference &x) const
|
||||
{
|
||||
static_assert(std::is_same<decltype(x.row()), std::uint32_t>::value, "this hash function expects both row and column to be 32-bit numbers");
|
||||
static_assert(std::is_same<decltype(x.column_index()), std::uint32_t>::value, "this hash function expects both row and column to be 32-bit numbers");
|
||||
return hash<std::uint64_t>{}(x.row() | static_cast<std::uint64_t>(x.column_index()) << 32);
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -26,6 +26,10 @@
|
|||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
||||
/// <summary>
|
||||
/// Enumerates the possible types a cell can be determined by it's current value.
|
||||
/// </summary>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
|
@ -33,18 +37,22 @@ namespace xlnt {
|
|||
/// </summary>
|
||||
enum class XLNT_API cell_type
|
||||
{
|
||||
/// no value. note: this is different from an empty string value or 0 numeric value
|
||||
null,
|
||||
/// number
|
||||
numeric,
|
||||
/// string
|
||||
string,
|
||||
/// value is a formula
|
||||
formula,
|
||||
/// no value
|
||||
empty,
|
||||
/// value is TRUE or FALSE
|
||||
boolean,
|
||||
/// value is an ISO 8601 formatted date
|
||||
date,
|
||||
/// value is a known error code such as \#VALUE!
|
||||
error,
|
||||
/// value is TRUE or FALSE
|
||||
boolean
|
||||
/// value is a string stored in the cell
|
||||
inline_string,
|
||||
/// value is a number
|
||||
number,
|
||||
/// value is a string shared with other cells to save space
|
||||
shared_string,
|
||||
/// value is the string result of a formula
|
||||
formula_string
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -52,27 +52,27 @@ public:
|
|||
comment(const std::string &text, const std::string &author);
|
||||
|
||||
/// <summary>
|
||||
/// Return the text that will be displayed for this comment.
|
||||
/// Returns the text that will be displayed for this comment.
|
||||
/// </summary>
|
||||
rich_text text() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the plain text that will be displayed for this comment without formatting information.
|
||||
/// Returns the plain text that will be displayed for this comment without formatting information.
|
||||
/// </summary>
|
||||
std::string plain_text() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return the author of this comment.
|
||||
/// Returns the author of this comment.
|
||||
/// </summary>
|
||||
std::string author() const;
|
||||
|
||||
/// <summary>
|
||||
/// Make this comment only visible when the associated cell is hovered.
|
||||
/// Makes this comment only visible when the associated cell is hovered.
|
||||
/// </summary>
|
||||
void hide();
|
||||
|
||||
/// <summary>
|
||||
/// Make this comment always visible.
|
||||
/// Makes this comment always visible.
|
||||
/// </summary>
|
||||
void show();
|
||||
|
||||
|
@ -82,7 +82,7 @@ public:
|
|||
bool visible() const;
|
||||
|
||||
/// <summary>
|
||||
/// Set the absolute position of this cell to the given coordinates.
|
||||
/// Sets the absolute position of this cell to the given coordinates.
|
||||
/// </summary>
|
||||
void position(int left, int top);
|
||||
|
||||
|
@ -97,7 +97,7 @@ public:
|
|||
int top() const;
|
||||
|
||||
/// <summary>
|
||||
/// Set the size of the comment.
|
||||
/// Sets the size of the comment.
|
||||
/// </summary>
|
||||
void size(int width, int height);
|
||||
|
||||
|
@ -112,9 +112,14 @@ public:
|
|||
int height() const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if both comments are equivalent.
|
||||
/// Return true if this comment is equivalent to other.
|
||||
/// </summary>
|
||||
friend XLNT_API bool operator==(const comment &left, const comment &right);
|
||||
bool operator==(const comment &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this comment is not equivalent to other.
|
||||
/// </summary>
|
||||
bool operator!=(const comment &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
|
@ -150,12 +155,12 @@ private:
|
|||
/// <summary>
|
||||
/// Width of the comment box.
|
||||
/// </summary>
|
||||
int width_ = 0;
|
||||
int width_ = 200;
|
||||
|
||||
/// <summary>
|
||||
/// Height of the comment box.
|
||||
/// </summary>
|
||||
int height_ = 0;
|
||||
int height_ = 100;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
// Copyright (c) 2018 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <string>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
namespace detail {
|
||||
struct hyperlink_impl;
|
||||
}
|
||||
|
||||
class cell;
|
||||
class range;
|
||||
class relationship;
|
||||
|
||||
/// <summary>
|
||||
/// Describes a hyperlink pointing from a cell to another cell or a URL.
|
||||
/// </summary>
|
||||
class XLNT_API hyperlink
|
||||
{
|
||||
public:
|
||||
bool external() const;
|
||||
class relationship relationship() const;
|
||||
// external target
|
||||
std::string url() const;
|
||||
// internal target
|
||||
std::string target_range() const;
|
||||
|
||||
bool has_display() const;
|
||||
void display(const std::string &value);
|
||||
const std::string &display() const;
|
||||
|
||||
bool has_tooltip() const;
|
||||
void tooltip(const std::string &value);
|
||||
const std::string &tooltip() const;
|
||||
|
||||
bool has_location() const;
|
||||
void location(const std::string &value);
|
||||
const std::string &location() const;
|
||||
|
||||
private:
|
||||
friend class cell;
|
||||
hyperlink(detail::hyperlink_impl *d);
|
||||
detail::hyperlink_impl *d_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -48,7 +48,7 @@ class XLNT_API column_t
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Alias declaration for the internal numeric type of this column.
|
||||
/// </summary>
|
||||
using index_t = std::uint32_t;
|
||||
|
||||
|
@ -73,237 +73,192 @@ public:
|
|||
static std::string column_string_from_index(index_t column_index);
|
||||
|
||||
/// <summary>
|
||||
/// Default column_t is the first (left-most) column.
|
||||
/// Default constructor. The column points to the "A" column.
|
||||
/// </summary>
|
||||
column_t();
|
||||
|
||||
/// <summary>
|
||||
/// Construct a column from a number.
|
||||
/// Constructs a column from a number.
|
||||
/// </summary>
|
||||
column_t(index_t column_index);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a column from a string.
|
||||
/// Constructs a column from a string.
|
||||
/// </summary>
|
||||
column_t(const std::string &column_string);
|
||||
|
||||
/// <summary>
|
||||
/// Construct a column from a string.
|
||||
/// Constructs a column from a string.
|
||||
/// </summary>
|
||||
column_t(const char *column_string);
|
||||
|
||||
/// <summary>
|
||||
/// Copy constructor
|
||||
/// </summary>
|
||||
column_t(const column_t &other);
|
||||
|
||||
/// <summary>
|
||||
/// Move constructor
|
||||
/// </summary>
|
||||
column_t(column_t &&other);
|
||||
|
||||
/// <summary>
|
||||
/// Return a string representation of this column index.
|
||||
/// Returns a string representation of this column index.
|
||||
/// </summary>
|
||||
std::string column_string() const;
|
||||
|
||||
/// <summary>
|
||||
/// Set this column to be the same as rhs's and return reference to self.
|
||||
/// </summary>
|
||||
column_t &operator=(column_t rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Set this column to be equal to rhs and return reference to self.
|
||||
/// Sets this column to be equal to rhs and return reference to self.
|
||||
/// </summary>
|
||||
column_t &operator=(const std::string &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Set this column to be equal to rhs and return reference to self.
|
||||
/// Sets this column to be equal to rhs and return reference to self.
|
||||
/// </summary>
|
||||
column_t &operator=(const char *rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column refers to the same column as other.
|
||||
/// Returns true if this column refers to the same column as other.
|
||||
/// </summary>
|
||||
bool operator==(const column_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column doesn't refer to the same column as other.
|
||||
/// Returns true if this column doesn't refer to the same column as other.
|
||||
/// </summary>
|
||||
bool operator!=(const column_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column refers to the same column as other.
|
||||
/// Returns true if this column refers to the same column as other.
|
||||
/// </summary>
|
||||
bool operator==(int other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column refers to the same column as other.
|
||||
/// Returns true if this column refers to the same column as other.
|
||||
/// </summary>
|
||||
bool operator==(index_t other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column refers to the same column as other.
|
||||
/// Returns true if this column refers to the same column as other.
|
||||
/// </summary>
|
||||
bool operator==(const std::string &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column refers to the same column as other.
|
||||
/// Returns true if this column refers to the same column as other.
|
||||
/// </summary>
|
||||
bool operator==(const char *other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column doesn't refer to the same column as other.
|
||||
/// Returns true if this column doesn't refer to the same column as other.
|
||||
/// </summary>
|
||||
bool operator!=(int other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column doesn't refer to the same column as other.
|
||||
/// Returns true if this column doesn't refer to the same column as other.
|
||||
/// </summary>
|
||||
bool operator!=(index_t other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column doesn't refer to the same column as other.
|
||||
/// Returns true if this column doesn't refer to the same column as other.
|
||||
/// </summary>
|
||||
bool operator!=(const std::string &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if this column doesn't refer to the same column as other.
|
||||
/// Returns true if this column doesn't refer to the same column as other.
|
||||
/// </summary>
|
||||
bool operator!=(const char *other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the right of this column.
|
||||
/// Returns true if other is to the right of this column.
|
||||
/// </summary>
|
||||
bool operator>(const column_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the right of or equal to this column.
|
||||
/// Returns true if other is to the right of or equal to this column.
|
||||
/// </summary>
|
||||
bool operator>=(const column_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the left of this column.
|
||||
/// Returns true if other is to the left of this column.
|
||||
/// </summary>
|
||||
bool operator<(const column_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the left of or equal to this column.
|
||||
/// Returns true if other is to the left of or equal to this column.
|
||||
/// </summary>
|
||||
bool operator<=(const column_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the right of this column.
|
||||
/// Returns true if other is to the right of this column.
|
||||
/// </summary>
|
||||
bool operator>(const column_t::index_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the right of or equal to this column.
|
||||
/// Returns true if other is to the right of or equal to this column.
|
||||
/// </summary>
|
||||
bool operator>=(const column_t::index_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the left of this column.
|
||||
/// Returns true if other is to the left of this column.
|
||||
/// </summary>
|
||||
bool operator<(const column_t::index_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the left of or equal to this column.
|
||||
/// Returns true if other is to the left of or equal to this column.
|
||||
/// </summary>
|
||||
bool operator<=(const column_t::index_t &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Pre-increment this column, making it point to the column one to the right.
|
||||
/// Pre-increments this column, making it point to the column one to the right and returning a reference to it.
|
||||
/// </summary>
|
||||
column_t &operator++();
|
||||
|
||||
/// <summary>
|
||||
/// Pre-deccrement this column, making it point to the column one to the left.
|
||||
/// Pre-deccrements this column, making it point to the column one to the left and returning a reference to it.
|
||||
/// </summary>
|
||||
column_t &operator--();
|
||||
|
||||
/// <summary>
|
||||
/// Post-increment this column, making it point to the column one to the right and returning the old column.
|
||||
/// Post-increments this column, making it point to the column one to the right and returning the old column.
|
||||
/// </summary>
|
||||
column_t operator++(int);
|
||||
|
||||
/// <summary>
|
||||
/// Post-decrement this column, making it point to the column one to the left and returning the old column.
|
||||
/// Post-decrements this column, making it point to the column one to the left and returning the old column.
|
||||
/// </summary>
|
||||
column_t operator--(int);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of adding rhs to this column.
|
||||
/// Returns the result of adding rhs to this column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator+(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of subtracing lhs by rhs column.
|
||||
/// Returns the result of subtracing lhs by rhs column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator-(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of multiply lhs by rhs column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator*(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of divide lhs by rhs column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator/(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return the result of mod lhs by rhs column.
|
||||
/// </summary>
|
||||
friend XLNT_API column_t operator%(column_t lhs, const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Add rhs to this column and return a reference to this column.
|
||||
/// Adds rhs to this column and returns a reference to this column.
|
||||
/// </summary>
|
||||
column_t &operator+=(const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Subtrac rhs from this column and return a reference to this column.
|
||||
/// Subtracts rhs from this column and returns a reference to this column.
|
||||
/// </summary>
|
||||
column_t &operator-=(const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Multiply this column by rhs and return a reference to this column.
|
||||
/// </summary>
|
||||
column_t &operator*=(const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Divide this column by rhs and return a reference to this column.
|
||||
/// </summary>
|
||||
column_t &operator/=(const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Mod this column by rhs and return a reference to this column.
|
||||
/// </summary>
|
||||
column_t &operator%=(const column_t &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the right of this column.
|
||||
/// Returns true if other is to the right of this column.
|
||||
/// </summary>
|
||||
friend XLNT_API bool operator>(const column_t::index_t &left, const column_t &right);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the right of or equal to this column.
|
||||
/// Returns true if other is to the right of or equal to this column.
|
||||
/// </summary>
|
||||
friend XLNT_API bool operator>=(const column_t::index_t &left, const column_t &right);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the left of this column.
|
||||
/// Returns true if other is to the left of this column.
|
||||
/// </summary>
|
||||
friend XLNT_API bool operator<(const column_t::index_t &left, const column_t &right);
|
||||
|
||||
/// <summary>
|
||||
/// Return true if other is to the left of or equal to this column.
|
||||
/// Returns true if other is to the left of or equal to this column.
|
||||
/// </summary>
|
||||
friend XLNT_API bool operator<=(const column_t::index_t &left, const column_t &right);
|
||||
|
||||
/// <summary>
|
||||
/// Swap the columns that left and right refer to.
|
||||
/// Swaps the columns that left and right refer to.
|
||||
/// </summary>
|
||||
friend XLNT_API void swap(column_t &left, column_t &right);
|
||||
|
||||
|
@ -313,14 +268,20 @@ public:
|
|||
index_t index;
|
||||
};
|
||||
|
||||
enum class row_or_col_t : int
|
||||
{
|
||||
row,
|
||||
column
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Functor for hashing a column.
|
||||
/// Allows for use of std::unordered_set<column, column_hash> and similar.
|
||||
/// Allows for use of std::unordered_set<column_t, column_hash> and similar.
|
||||
/// </summary>
|
||||
struct XLNT_API column_hash
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the result of hashing column k.
|
||||
/// </summary>
|
||||
std::size_t operator()(const column_t &k) const;
|
||||
};
|
||||
|
@ -336,7 +297,7 @@ template <>
|
|||
struct hash<xlnt::column_t>
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the result of hashing column k.
|
||||
/// </summary>
|
||||
size_t operator()(const xlnt::column_t &k) const
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
// Copyright (c) 2016-2020
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -15,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -24,23 +23,24 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
/// Text can be aligned horizontally in these enumerated ways.
|
||||
/// Encapsulates a run of text that
|
||||
/// </summary>
|
||||
enum class XLNT_API horizontal_alignment
|
||||
struct XLNT_API phonetic_run
|
||||
{
|
||||
general,
|
||||
left,
|
||||
center,
|
||||
right,
|
||||
fill,
|
||||
justify,
|
||||
center_continuous,
|
||||
distributed
|
||||
std::string text;
|
||||
uint32_t start;
|
||||
uint32_t end;
|
||||
bool preserve_space;
|
||||
|
||||
bool operator==(const phonetic_run &other) const;
|
||||
bool operator!=(const phonetic_run &other) const;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2016 Thomas Fussell
|
||||
// Copyright (c) 2016-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -27,7 +27,9 @@
|
|||
#include <vector>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/cell/phonetic_run.hpp>
|
||||
#include <xlnt/cell/rich_text_run.hpp>
|
||||
#include <xlnt/worksheet/phonetic_pr.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
@ -39,38 +41,43 @@ class XLNT_API rich_text
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs an empty rich text object with no font and empty text.
|
||||
/// </summary>
|
||||
rich_text() = default;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a rich text object with the given text and no font.
|
||||
/// </summary>
|
||||
rich_text(const std::string &plain_text);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a rich text object from other
|
||||
/// </summary>
|
||||
rich_text(const rich_text &other);
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a rich text object with the given text and font.
|
||||
/// </summary>
|
||||
rich_text(const std::string &plain_text, const class font &text_font);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Copy constructor.
|
||||
/// </summary>
|
||||
rich_text(const rich_text_run &single_run);
|
||||
|
||||
/// <summary>
|
||||
/// Remove all text runs from this text.
|
||||
/// Removes all text runs from this text.
|
||||
/// </summary>
|
||||
void clear();
|
||||
|
||||
/// <summary>
|
||||
/// Clear any runs in this text and add a single run with default formatting and
|
||||
/// Clears any runs in this text and adds a single run with default formatting and
|
||||
/// the given string as its textual content.
|
||||
/// </summary>
|
||||
void plain_text(const std::string &s);
|
||||
void plain_text(const std::string &s, bool preserve_space);
|
||||
|
||||
/// <summary>
|
||||
/// Combine the textual content of each text run in order and return the result.
|
||||
/// Combines the textual content of each text run in order and returns the result.
|
||||
/// </summary>
|
||||
std::string plain_text() const;
|
||||
|
||||
|
@ -80,30 +87,93 @@ public:
|
|||
std::vector<rich_text_run> runs() const;
|
||||
|
||||
/// <summary>
|
||||
/// Set the runs of this text all at once.
|
||||
/// Sets the runs of this text all at once.
|
||||
/// </summary>
|
||||
void runs(const std::vector<rich_text_run> &new_runs);
|
||||
|
||||
/// <summary>
|
||||
/// Add a new run to the end of the set of runs.
|
||||
/// Adds a new run to the end of the set of runs.
|
||||
/// </summary>
|
||||
void add_run(const rich_text_run &t);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a copy of the individual runs that comprise this text.
|
||||
/// </summary>
|
||||
std::vector<phonetic_run> phonetic_runs() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the runs of this text all at once.
|
||||
/// </summary>
|
||||
void phonetic_runs(const std::vector<phonetic_run> &new_phonetic_runs);
|
||||
|
||||
/// <summary>
|
||||
/// Adds a new run to the end of the set of runs.
|
||||
/// </summary>
|
||||
void add_phonetic_run(const phonetic_run &t);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this text has phonetic properties
|
||||
/// </summary>
|
||||
bool has_phonetic_properties() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the phonetic properties of this text.
|
||||
/// </summary>
|
||||
const phonetic_pr &phonetic_properties() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the phonetic properties of this text to phonetic_props
|
||||
/// </summary>
|
||||
void phonetic_properties(const phonetic_pr &phonetic_props);
|
||||
|
||||
/// <summary>
|
||||
/// Copies rich text object from other
|
||||
/// </summary>
|
||||
rich_text &operator=(const rich_text &rhs);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the runs that make up this text are identical to those in rhs.
|
||||
/// </summary>
|
||||
bool operator==(const rich_text &rhs) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the runs that make up this text are identical to those in rhs.
|
||||
/// </summary>
|
||||
bool operator!=(const rich_text &rhs) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this text has a single unformatted run with text equal to rhs.
|
||||
/// </summary>
|
||||
bool operator==(const std::string &rhs) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this text has a single unformatted run with text equal to rhs.
|
||||
/// </summary>
|
||||
bool operator!=(const std::string &rhs) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The runs that make up this rich text.
|
||||
/// </summary>
|
||||
std::vector<rich_text_run> runs_;
|
||||
std::vector<phonetic_run> phonetic_runs_;
|
||||
optional<phonetic_pr> phonetic_properties_;
|
||||
};
|
||||
|
||||
class XLNT_API rich_text_hash
|
||||
{
|
||||
public:
|
||||
std::size_t operator()(const rich_text &k) const
|
||||
{
|
||||
std::size_t res = 0;
|
||||
|
||||
for (auto r : k.runs())
|
||||
{
|
||||
res ^= std::hash<std::string>()(r.first);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2016 Thomas Fussell
|
||||
// Copyright (c) 2016-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -31,6 +31,18 @@
|
|||
|
||||
namespace xlnt {
|
||||
|
||||
using rich_text_run = std::pair<std::string, optional<font>>;
|
||||
/// <summary>
|
||||
/// Typedef a rich_text_run as a pair of string and optional font.
|
||||
/// </summary>
|
||||
struct XLNT_API rich_text_run
|
||||
{
|
||||
std::string first;
|
||||
optional<font> second;
|
||||
bool preserve_space;
|
||||
|
||||
bool operator==(const rich_text_run &other) const;
|
||||
|
||||
bool operator!=(const rich_text_run &other) const;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
// Copyright (c) 2018
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace xml {
|
||||
class parser;
|
||||
class serializer;
|
||||
} // namespace xml
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class worksheet;
|
||||
|
||||
namespace drawing {
|
||||
|
||||
/// <summary>
|
||||
/// The spreadsheet_drawing class encapsulates the information
|
||||
/// captured from objects within the spreadsheetDrawing schema.
|
||||
/// </summary>
|
||||
class XLNT_API spreadsheet_drawing
|
||||
{
|
||||
public:
|
||||
spreadsheet_drawing(xml::parser &parser);
|
||||
void serialize(xml::serializer &serializer);
|
||||
|
||||
std::vector<std::string> get_embed_ids();
|
||||
|
||||
private:
|
||||
std::string serialized_value_;
|
||||
std::vector<std::string> embed_ids_;
|
||||
};
|
||||
|
||||
} // namespace drawing
|
||||
} // namespace xlnt
|
|
@ -0,0 +1,79 @@
|
|||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/packaging/uri.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace xml {
|
||||
class parser;
|
||||
class serializer;
|
||||
} // namespace xml
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
/// A list of xml extensions that may or may not be understood by the parser
|
||||
/// preservation is required for round-tripping even if extension is not understood
|
||||
/// [serialised: extLst]
|
||||
/// </summary>
|
||||
class XLNT_API ext_list
|
||||
{
|
||||
public:
|
||||
struct ext
|
||||
{
|
||||
ext(xml::parser &parser, const std::string &ns);
|
||||
ext(const uri &ID, const std::string &serialised);
|
||||
void serialise(xml::serializer &serialiser, const std::string &ns);
|
||||
|
||||
uri extension_ID_;
|
||||
std::string serialised_value_;
|
||||
};
|
||||
ext_list() = default; // default ctor required by xlnt::optional
|
||||
explicit ext_list(xml::parser &parser, const std::string &ns);
|
||||
void serialize(xml::serializer &serialiser, const std::string &ns);
|
||||
|
||||
void add_extension(const uri &ID, const std::string &element);
|
||||
|
||||
bool has_extension(const uri &extension_uri) const;
|
||||
|
||||
const ext &extension(const uri &extension_uri) const;
|
||||
|
||||
const std::vector<ext> &extensions() const;
|
||||
|
||||
bool operator==(const ext_list &rhs) const;
|
||||
|
||||
private:
|
||||
std::vector<ext> extensions_;
|
||||
};
|
||||
|
||||
inline bool operator==(const ext_list::ext &lhs, const ext_list::ext &rhs)
|
||||
{
|
||||
return lhs.extension_ID_ == rhs.extension_ID_
|
||||
&& lhs.serialised_value_ == rhs.serialised_value_;
|
||||
}
|
||||
} // namespace xlnt
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -92,19 +92,22 @@ public:
|
|||
path canonicalize(const std::vector<xlnt::relationship> &rels) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Registers a new relationship by specifying all of the relationship properties explicitly.
|
||||
/// </summary>
|
||||
std::string register_relationship(const uri &source, relationship_type type, const uri &target, target_mode mode);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Registers a new relationship already constructed elsewhere.
|
||||
/// </summary>
|
||||
std::string register_relationship(const class relationship &rel);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Delete the relationship with the given id from source part. Returns a mapping
|
||||
/// of relationship IDs since IDs are shifted down. For example, if there are three
|
||||
/// relationships for part a.xml like [rId1, rId2, rId3] and rId2 is deleted, the
|
||||
/// resulting map would look like [rId3->rId2].
|
||||
/// </summary>
|
||||
void unregister_relationship(const uri &source, const std::string &rel_id);
|
||||
std::unordered_map<std::string, std::string> unregister_relationship(const uri &source, const std::string &rel_id);
|
||||
|
||||
// Content Types
|
||||
|
||||
|
@ -169,24 +172,26 @@ public:
|
|||
/// </summary>
|
||||
void unregister_override_type(const path &part);
|
||||
|
||||
bool operator==(const manifest &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the lowest rId for the given part that hasn't already been registered.
|
||||
/// </summary>
|
||||
std::string next_relationship_id(const path &part) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The map of extensions to default content types.
|
||||
/// </summary>
|
||||
std::unordered_map<std::string, std::string> default_content_types_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The map of package parts to overriding content types.
|
||||
/// </summary>
|
||||
std::unordered_map<path, std::string> override_content_types_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The map of package parts to their registered relationships.
|
||||
/// </summary>
|
||||
std::unordered_map<path, std::unordered_map<std::string, xlnt::relationship>> relationships_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -72,7 +72,6 @@ enum class XLNT_API relationship_type
|
|||
dialogsheet,
|
||||
drawings,
|
||||
external_workbook_references,
|
||||
metadata,
|
||||
pivot_table,
|
||||
pivot_table_cache_definition,
|
||||
pivot_table_cache_records,
|
||||
|
@ -89,6 +88,7 @@ enum class XLNT_API relationship_type
|
|||
vml_drawing,
|
||||
volatile_dependencies,
|
||||
worksheet,
|
||||
vbaproject,
|
||||
|
||||
// Worksheet parts
|
||||
hyperlink,
|
||||
|
@ -103,20 +103,20 @@ class XLNT_API relationship
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a new empty relationship.
|
||||
/// </summary>
|
||||
relationship();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a new relationship by specifying all of its properties.
|
||||
/// </summary>
|
||||
relationship(
|
||||
const std::string &id, relationship_type t, const uri &source, const uri &target, xlnt::target_mode mode);
|
||||
relationship(const std::string &id, relationship_type t, const uri &source,
|
||||
const uri &target, xlnt::target_mode mode);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string of the form rId# that identifies the relationship.
|
||||
/// </summary>
|
||||
std::string id() const;
|
||||
const std::string &id() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the type of this relationship.
|
||||
|
@ -131,12 +131,12 @@ public:
|
|||
/// <summary>
|
||||
/// Returns the URI of the package part this relationship points to.
|
||||
/// </summary>
|
||||
uri source() const;
|
||||
const uri &source() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the URI of the package part this relationship points to.
|
||||
/// </summary>
|
||||
uri target() const;
|
||||
const uri &target() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if and only if rhs is equal to this relationship.
|
||||
|
@ -150,27 +150,27 @@ public:
|
|||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The id of this relationship in the format "rId#"
|
||||
/// </summary>
|
||||
std::string id_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The type of this relationship.
|
||||
/// </summary>
|
||||
relationship_type type_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The URI of the source of this relationship.
|
||||
/// </summary>
|
||||
uri source_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The URI of the target of this relationshp.
|
||||
/// </summary>
|
||||
uri target_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Whether the target of this relationship is internal or external.
|
||||
/// </summary>
|
||||
xlnt::target_mode mode_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -31,194 +31,207 @@
|
|||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Encapsulates a uniform resource identifier (URI) as described
|
||||
/// by RFC 3986.
|
||||
/// </summary>
|
||||
class XLNT_API uri
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs an empty URI.
|
||||
/// </summary>
|
||||
uri();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a URI by combining base with relative.
|
||||
/// </summary>
|
||||
uri(const uri &base, const uri &relative);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a URI by combining base with relative path.
|
||||
/// </summary>
|
||||
uri(const uri &base, const path &relative);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a URI by parsing the given uri_string.
|
||||
/// </summary>
|
||||
uri(const std::string &uri_string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this URI is relative.
|
||||
/// </summary>
|
||||
bool is_relative() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this URI is not relative (i.e. absolute).
|
||||
/// </summary>
|
||||
bool is_absolute() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the scheme of this URI.
|
||||
/// E.g. the scheme of http://user:pass@example.com is "http"
|
||||
/// </summary>
|
||||
std::string scheme() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the authority of this URI.
|
||||
/// E.g. the authority of http://user:pass@example.com:80/document is "user:pass@example.com:80"
|
||||
/// </summary>
|
||||
std::string authority() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if an authentication section is specified for this URI.
|
||||
/// </summary>
|
||||
bool has_authentication() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the authentication of this URI.
|
||||
/// E.g. the authentication of http://user:pass@example.com is "user:pass"
|
||||
/// </summary>
|
||||
std::string authentication() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the username of this URI.
|
||||
/// E.g. the username of http://user:pass@example.com is "user"
|
||||
/// </summary>
|
||||
std::string username() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the password of this URI.
|
||||
/// E.g. the password of http://user:pass@example.com is "pass"
|
||||
/// </summary>
|
||||
std::string password() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the host of this URI.
|
||||
/// E.g. the host of http://example.com:80/document is "example.com"
|
||||
/// </summary>
|
||||
std::string host() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if a non-default port is specified for this URI.
|
||||
/// </summary>
|
||||
bool has_port() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the port of this URI.
|
||||
/// E.g. the port of https://example.com:443/document is "443"
|
||||
/// </summary>
|
||||
std::size_t port() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the path of this URI.
|
||||
/// E.g. the path of http://example.com/document is "/document"
|
||||
/// </summary>
|
||||
class path path() const;
|
||||
const class path &path() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this URI has a non-null query string section.
|
||||
/// </summary>
|
||||
bool has_query() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the query string of this URI.
|
||||
/// E.g. the query of http://example.com/document?v=1&x=3#abc is "v=1&x=3"
|
||||
/// </summary>
|
||||
std::string query() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this URI has a non-empty fragment section.
|
||||
/// </summary>
|
||||
bool has_fragment() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the fragment section of this URI.
|
||||
/// E.g. the fragment of http://example.com/document#abc is "abc"
|
||||
/// </summary>
|
||||
std::string fragment() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a string representation of this URI.
|
||||
/// </summary>
|
||||
std::string to_string() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// If this URI is relative, an absolute URI will be returned by appending
|
||||
/// the path to the given absolute base URI.
|
||||
/// </summary>
|
||||
uri make_absolute(const uri &base);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// If this URI is absolute, a relative URI will be returned by removing the
|
||||
/// common base path from the given absolute base URI.
|
||||
/// </summary>
|
||||
uri make_reference(const uri &base);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this URI is equivalent to other.
|
||||
/// </summary>
|
||||
friend XLNT_API bool operator==(const uri &left, const uri &right);
|
||||
bool operator==(const uri &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// True if this URI is absolute.
|
||||
/// </summary>
|
||||
bool absolute_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The scheme, like "http"
|
||||
/// </summary>
|
||||
std::string scheme_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// True if this URI has an authentication section.
|
||||
/// </summary>
|
||||
bool has_authentication_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The username
|
||||
/// </summary>
|
||||
std::string username_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The password
|
||||
/// </summary>
|
||||
std::string password_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The host
|
||||
/// </summary>
|
||||
std::string host_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// True if this URI has a non-default port specified
|
||||
/// </summary>
|
||||
bool has_port_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The numeric port
|
||||
/// </summary>
|
||||
std::size_t port_ = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// True if this URI has a query section
|
||||
/// </summary>
|
||||
bool has_query_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The query section
|
||||
/// </summary>
|
||||
std::string query_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// True if this URI has a fragment section
|
||||
/// </summary>
|
||||
bool has_fragment_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The fragment section
|
||||
/// </summary>
|
||||
std::string fragment_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The path section
|
||||
/// </summary>
|
||||
class path path_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -25,97 +25,143 @@
|
|||
#pragma once
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/styles/horizontal_alignment.hpp>
|
||||
#include <xlnt/styles/vertical_alignment.hpp>
|
||||
#include <xlnt/utils/optional.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
/// Alignment options for use in cell formats.
|
||||
/// Text can be aligned horizontally within a cell in these enumerated ways.
|
||||
/// </summary>
|
||||
enum class XLNT_API horizontal_alignment
|
||||
{
|
||||
general,
|
||||
left,
|
||||
center,
|
||||
right,
|
||||
fill,
|
||||
justify,
|
||||
center_continuous,
|
||||
distributed
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Text can be aligned vertically within a cell in these enumerated ways.
|
||||
/// </summary>
|
||||
enum class XLNT_API vertical_alignment
|
||||
{
|
||||
top,
|
||||
center,
|
||||
bottom,
|
||||
justify,
|
||||
distributed
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Alignment options that determine how text should be displayed within a cell.
|
||||
/// </summary>
|
||||
class XLNT_API alignment
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if shrink-to-fit has been enabled.
|
||||
/// </summary>
|
||||
bool shrink() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets whether the font size should be reduced until all of the text fits in a cell without wrapping.
|
||||
/// </summary>
|
||||
alignment &shrink(bool shrink_to_fit);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if text-wrapping has been enabled.
|
||||
/// </summary>
|
||||
bool wrap() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets whether text in a cell should continue to multiple lines if it doesn't fit in one line.
|
||||
/// </summary>
|
||||
alignment &wrap(bool wrap_text);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the optional value of indentation width in number of spaces.
|
||||
/// </summary>
|
||||
optional<int> indent() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the indent size in number of spaces from the side of the cell. This will only
|
||||
/// take effect when left or right horizontal alignment has also been set.
|
||||
/// </summary>
|
||||
alignment &indent(int indent_size);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the optional value of rotation for text in the cell in degrees.
|
||||
/// </summary>
|
||||
optional<int> rotation() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the rotation for text in the cell in degrees.
|
||||
/// </summary>
|
||||
alignment &rotation(int text_rotation);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the optional horizontal alignment.
|
||||
/// </summary>
|
||||
optional<horizontal_alignment> horizontal() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the horizontal alignment.
|
||||
/// </summary>
|
||||
alignment &horizontal(horizontal_alignment horizontal);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the optional vertical alignment.
|
||||
/// </summary>
|
||||
optional<vertical_alignment> vertical() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the vertical alignment.
|
||||
/// </summary>
|
||||
alignment &vertical(vertical_alignment vertical);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// Returns true if this alignment is equivalent to other.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const alignment &left, const alignment &right);
|
||||
bool operator==(const alignment &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// Returns true if this alignment is not equivalent to other.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const alignment &left, const alignment &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
bool operator!=(const alignment &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
/// Whether or not to shrink font size until it fits on one line
|
||||
/// </summary>
|
||||
bool shrink_to_fit_ = false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not to wrap text to the next line
|
||||
/// </summary>
|
||||
bool wrap_text_ = false;
|
||||
|
||||
/// <summary>
|
||||
/// The indent in number of spaces from the side
|
||||
/// </summary>
|
||||
optional<int> indent_;
|
||||
|
||||
/// <summary>
|
||||
/// The text roation in degrees
|
||||
/// </summary>
|
||||
optional<int> text_rotation_;
|
||||
|
||||
/// <summary>
|
||||
/// The horizontal alignment
|
||||
/// </summary>
|
||||
optional<horizontal_alignment> horizontal_;
|
||||
|
||||
/// <summary>
|
||||
/// The vertical alignment
|
||||
/// </summary>
|
||||
optional<vertical_alignment> vertical_;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -30,15 +30,13 @@
|
|||
#include <vector>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/styles/border_style.hpp>
|
||||
#include <xlnt/styles/color.hpp>
|
||||
#include <xlnt/styles/diagonal_direction.hpp>
|
||||
#include <xlnt/utils/optional.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Enumerates the sides of a cell to which a border style can be applied.
|
||||
/// </summary>
|
||||
enum class XLNT_API border_side
|
||||
{
|
||||
|
@ -51,6 +49,40 @@ enum class XLNT_API border_side
|
|||
horizontal
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Enumerates the pattern of the border lines on a particular side.
|
||||
/// </summary>
|
||||
enum class XLNT_API border_style
|
||||
{
|
||||
none,
|
||||
dashdot,
|
||||
dashdotdot,
|
||||
dashed,
|
||||
dotted,
|
||||
double_,
|
||||
hair,
|
||||
medium,
|
||||
mediumdashdot,
|
||||
mediumdashdotdot,
|
||||
mediumdashed,
|
||||
slantdashdot,
|
||||
thick,
|
||||
thin
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Cells can have borders that go from the top-left to bottom-right
|
||||
/// or from the top-right to bottom-left, or both, or neither.
|
||||
/// Used by style->border.
|
||||
/// </summary>
|
||||
enum class XLNT_API diagonal_direction
|
||||
{
|
||||
neither,
|
||||
up,
|
||||
down,
|
||||
both
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
||||
namespace xlnt {
|
||||
|
@ -62,139 +94,132 @@ class XLNT_API border
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Each side of a cell can have a border_property applied to it to change
|
||||
/// how it is displayed.
|
||||
/// </summary>
|
||||
class XLNT_API border_property
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color of the side.
|
||||
/// </summary>
|
||||
optional<class color> color() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the color of the side and returns a reference to the side properties.
|
||||
/// </summary>
|
||||
border_property &color(const xlnt::color &c);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the style of the side.
|
||||
/// </summary>
|
||||
optional<border_style> style() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the style of the side and returns a reference to the side properties.
|
||||
/// </summary>
|
||||
border_property &style(border_style style);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
friend bool operator==(const border_property &left, const border_property &right);
|
||||
bool operator==(const border_property &right) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
friend bool operator!=(const border_property &left, const border_property &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
bool operator!=(const border_property &right) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The color of the side
|
||||
/// </summary>
|
||||
optional<class color> color_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The style of the side
|
||||
/// </summary>
|
||||
optional<border_style> style_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a vector containing all of the border sides to be used for iteration.
|
||||
/// </summary>
|
||||
static const std::vector<border_side> &all_sides();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a default border.
|
||||
/// </summary>
|
||||
border();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the border properties of the given side.
|
||||
/// </summary>
|
||||
optional<border_property> side(border_side s) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the border properties of the side s to prop.
|
||||
/// </summary>
|
||||
border &side(border_side s, const border_property &prop);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the diagonal direction of this border.
|
||||
/// </summary>
|
||||
optional<diagonal_direction> diagonal() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the diagonal direction of this border to dir.
|
||||
/// </summary>
|
||||
border &diagonal(diagonal_direction dir);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const border &left, const border &right);
|
||||
bool operator==(const border &right) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const border &left, const border &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
bool operator!=(const border &right) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// Start side (i.e. left) border properties
|
||||
/// </summary>
|
||||
optional<border_property> start_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// End side (i.e. right) border properties
|
||||
/// </summary>
|
||||
optional<border_property> end_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Top side border properties
|
||||
/// </summary>
|
||||
optional<border_property> top_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Bottom side border properties
|
||||
/// </summary>
|
||||
optional<border_property> bottom_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Vertical border properties
|
||||
/// </summary>
|
||||
optional<border_property> vertical_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Horizontal border properties
|
||||
/// </summary>
|
||||
optional<border_property> horizontal_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Diagonal border properties
|
||||
/// </summary>
|
||||
optional<border_property> diagonal_;
|
||||
|
||||
// bool outline_ = true;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Direction of diagonal border properties to be applied
|
||||
/// </summary>
|
||||
optional<diagonal_direction> diagonal_direction_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -28,124 +28,122 @@
|
|||
#include <string>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/utils/optional.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// An indexed color encapsulates a simple index to a color in the indexedColors of the stylesheet.
|
||||
/// </summary>
|
||||
class XLNT_API indexed_color
|
||||
{
|
||||
public:
|
||||
//TODO: should this be explicit?
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs an indexed_color from an index.
|
||||
/// </summary>
|
||||
indexed_color(std::size_t index);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the index this color points to.
|
||||
/// </summary>
|
||||
std::size_t index() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the index to index.
|
||||
/// </summary>
|
||||
void index(std::size_t index);
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The index of this color
|
||||
/// </summary>
|
||||
std::size_t index_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// A theme color encapsulates a color derived from the theme.
|
||||
/// </summary>
|
||||
class XLNT_API theme_color
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a theme_color from an index.
|
||||
/// </summary>
|
||||
theme_color(std::size_t index);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the index of the color in the theme this points to.
|
||||
/// </summary>
|
||||
std::size_t index() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the index of this color to index.
|
||||
/// </summary>
|
||||
void index(std::size_t index);
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The index of the color
|
||||
/// </summary>
|
||||
std::size_t index_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// An RGB color describes a color in terms of its red, green, blue, and alpha components.
|
||||
/// </summary>
|
||||
class XLNT_API rgb_color
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs an RGB color from a string in the form \#[aa]rrggbb
|
||||
/// </summary>
|
||||
rgb_color(const std::string &hex_string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs an RGB color from red, green, and blue values in the range 0 to 255
|
||||
/// plus an optional alpha which defaults to fully opaque.
|
||||
/// </summary>
|
||||
rgb_color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 255);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a string representation of this color in the form \#aarrggbb
|
||||
/// </summary>
|
||||
std::string hex_string() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a byte representing the red component of this color
|
||||
/// </summary>
|
||||
std::uint8_t red() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a byte representing the red component of this color
|
||||
/// </summary>
|
||||
std::uint8_t green() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a byte representing the blue component of this color
|
||||
/// </summary>
|
||||
std::uint8_t blue() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a byte representing the alpha component of this color
|
||||
/// </summary>
|
||||
std::uint8_t alpha() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the red, green, and blue components of this color separately in an array in that order.
|
||||
/// </summary>
|
||||
std::array<std::uint8_t, 3> rgb() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the red, green, blue, and alpha components of this color separately in an array in that order.
|
||||
/// </summary>
|
||||
std::array<std::uint8_t, 4> rgba() const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
static std::array<std::uint8_t, 4> decode_hex_string(const std::string &hex_string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The four bytes of this color
|
||||
/// </summary>
|
||||
std::array<std::uint8_t, 4> rgba_;
|
||||
};
|
||||
|
@ -167,163 +165,186 @@ class XLNT_API color
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#000000
|
||||
/// </summary>
|
||||
static const color black();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#ffffff
|
||||
/// </summary>
|
||||
static const color white();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#ff0000
|
||||
/// </summary>
|
||||
static const color red();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#8b0000
|
||||
/// </summary>
|
||||
static const color darkred();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#00ff00
|
||||
/// </summary>
|
||||
static const color blue();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#008b00
|
||||
/// </summary>
|
||||
static const color darkblue();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#0000ff
|
||||
/// </summary>
|
||||
static const color green();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#00008b
|
||||
/// </summary>
|
||||
static const color darkgreen();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#ffff00
|
||||
/// </summary>
|
||||
static const color yellow();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color \#cccc00
|
||||
/// </summary>
|
||||
static const color darkyellow();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a default color
|
||||
/// </summary>
|
||||
color();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a color from a given RGB color
|
||||
/// </summary>
|
||||
color(const rgb_color &rgb);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a color from a given indexed color
|
||||
/// </summary>
|
||||
color(const indexed_color &indexed);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a color from a given theme color
|
||||
/// </summary>
|
||||
color(const theme_color &theme);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the type of this color
|
||||
/// </summary>
|
||||
color_type type() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this color has been set to auto
|
||||
/// </summary>
|
||||
bool is_auto() const;
|
||||
bool auto_() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the auto property of this color to value
|
||||
/// </summary>
|
||||
void auto_(bool value);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the internal indexed color representing this color. If this is not an RGB color,
|
||||
/// an invalid_attribute exception will be thrown.
|
||||
/// </summary>
|
||||
const rgb_color &rgb() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the internal indexed color representing this color. If this is not an RGB color,
|
||||
/// an invalid_attribute exception will be thrown.
|
||||
/// </summary>
|
||||
rgb_color &rgb();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the internal indexed color representing this color. If this is not an indexed color,
|
||||
/// an invalid_attribute exception will be thrown.
|
||||
/// </summary>
|
||||
const indexed_color &indexed() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the internal indexed color representing this color. If this is not an indexed color,
|
||||
/// an invalid_attribute exception will be thrown.
|
||||
/// </summary>
|
||||
indexed_color &indexed();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the internal indexed color representing this color. If this is not a theme color,
|
||||
/// an invalid_attribute exception will be thrown.
|
||||
/// </summary>
|
||||
const theme_color &theme() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the internal indexed color representing this color. If this is not a theme color,
|
||||
/// an invalid_attribute exception will be thrown.
|
||||
/// </summary>
|
||||
theme_color &theme();
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if tint is set
|
||||
/// </summary>
|
||||
bool has_tint() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the tint of this color.
|
||||
/// </summary>
|
||||
double tint() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the tint of this color to tint. Tints lighten or darken an existing color by multiplying the color with the tint.
|
||||
/// </summary>
|
||||
void tint(double tint);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this color is equivalent to other
|
||||
/// </summary>
|
||||
bool operator==(const color &other) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this color is not equivalent to other
|
||||
/// </summary>
|
||||
bool operator!=(const color &other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
bool operator!=(const color &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// Throws an invalid_attribute exception if the given type is different from this color's type
|
||||
/// </summary>
|
||||
void assert_type(color_type t) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The type of this color
|
||||
/// </summary>
|
||||
color_type type_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The internal RGB color. Only valid when this color has a type of rgb
|
||||
/// </summary>
|
||||
rgb_color rgb_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The internal RGB color. Only valid when this color has a type of indexed
|
||||
/// </summary>
|
||||
indexed_color indexed_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The internal RGB color. Only valid when this color has a type of theme
|
||||
/// </summary>
|
||||
theme_color theme_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The tint of this color
|
||||
/// </summary>
|
||||
double tint_;
|
||||
optional<double> tint_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Whether or not this is an auto color
|
||||
/// </summary>
|
||||
bool auto__;
|
||||
bool auto_color = false;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
||||
|
|
|
@ -0,0 +1,170 @@
|
|||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/utils/optional.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
class border;
|
||||
class fill;
|
||||
class font;
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct conditional_format_impl;
|
||||
struct stylesheet;
|
||||
class xlsx_consumer;
|
||||
class xlsx_producer;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
class XLNT_API condition
|
||||
{
|
||||
public:
|
||||
static condition text_starts_with(const std::string &start);
|
||||
static condition text_ends_with(const std::string &end);
|
||||
static condition text_contains(const std::string &start);
|
||||
static condition text_does_not_contain(const std::string &start);
|
||||
|
||||
bool operator==(const condition &rhs) const
|
||||
{
|
||||
return text_comparand_ == rhs.text_comparand_;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class detail::xlsx_producer;
|
||||
|
||||
enum class type
|
||||
{
|
||||
contains_text
|
||||
} type_;
|
||||
|
||||
enum class condition_operator
|
||||
{
|
||||
starts_with,
|
||||
ends_with,
|
||||
contains,
|
||||
does_not_contain
|
||||
} operator_;
|
||||
|
||||
std::string text_comparand_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Describes a conditional format that will be applied to all cells in the
|
||||
/// associated range that satisfy the condition. This can only be constructed
|
||||
/// using methods on worksheet or range.
|
||||
/// </summary>
|
||||
class XLNT_API conditional_format
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
/// Delete zero-argument constructor
|
||||
/// </summary>
|
||||
conditional_format() = delete;
|
||||
|
||||
/// <summary>
|
||||
/// Default copy constructor. Constructs a format using the same PIMPL as other.
|
||||
/// </summary>
|
||||
conditional_format(const conditional_format &other) = default;
|
||||
|
||||
// Formatting (xf) components
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_border() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class border border() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
conditional_format border(const xlnt::border &new_border);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_fill() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class fill fill() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
conditional_format fill(const xlnt::fill &new_fill);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool has_font() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class font font() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
conditional_format font(const xlnt::font &new_font);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this format is equivalent to other.
|
||||
/// </summary>
|
||||
bool operator==(const conditional_format &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this format is not equivalent to other.
|
||||
/// </summary>
|
||||
bool operator!=(const conditional_format &other) const;
|
||||
|
||||
private:
|
||||
friend struct detail::stylesheet;
|
||||
friend class detail::xlsx_consumer;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
conditional_format(detail::conditional_format_impl *d);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
detail::conditional_format_impl *d_;
|
||||
};
|
||||
|
||||
} // namespace xlnt
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -33,7 +33,7 @@
|
|||
namespace xlnt {
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The pattern of pixels upon which the corresponding pattern fill will be displayed
|
||||
/// </summary>
|
||||
enum class XLNT_API pattern_fill_type
|
||||
{
|
||||
|
@ -59,78 +59,76 @@ enum class XLNT_API pattern_fill_type
|
|||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Represents a fill which colors the cell based on a foreground and
|
||||
/// background color and a pattern.
|
||||
/// </summary>
|
||||
class XLNT_API pattern_fill
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a default pattern fill with a none pattern and no colors.
|
||||
/// </summary>
|
||||
pattern_fill();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the pattern used by this fill
|
||||
/// </summary>
|
||||
pattern_fill_type type() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the pattern of this fill and returns a reference to it.
|
||||
/// </summary>
|
||||
pattern_fill &type(pattern_fill_type new_type);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the optional foreground color of this fill
|
||||
/// </summary>
|
||||
optional<color> foreground() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the foreground color and returns a reference to this pattern.
|
||||
/// </summary>
|
||||
pattern_fill &foreground(const color &foreground);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the optional background color of this fill
|
||||
/// </summary>
|
||||
optional<color> background() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the foreground color and returns a reference to this pattern.
|
||||
/// </summary>
|
||||
pattern_fill &background(const color &background);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// Returns true if this pattern fill is equivalent to other.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const pattern_fill &left, const pattern_fill &right);
|
||||
bool operator==(const pattern_fill &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// Returns true if this pattern fill is not equivalent to other.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const pattern_fill &left, const pattern_fill &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
bool operator!=(const pattern_fill &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The type of this pattern_fill
|
||||
/// </summary>
|
||||
pattern_fill_type type_ = pattern_fill_type::none;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The optional foreground color
|
||||
/// </summary>
|
||||
optional<color> foreground_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// THe optional background color
|
||||
/// </summary>
|
||||
optional<color> background_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Enumerates the types of gradient fills
|
||||
/// </summary>
|
||||
enum class XLNT_API gradient_fill_type
|
||||
{
|
||||
|
@ -139,157 +137,154 @@ enum class XLNT_API gradient_fill_type
|
|||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Encapsulates a fill which transitions between colors at particular "stops".
|
||||
/// </summary>
|
||||
class XLNT_API gradient_fill
|
||||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a default linear fill
|
||||
/// </summary>
|
||||
gradient_fill();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the type of this gradient fill
|
||||
/// </summary>
|
||||
gradient_fill_type type() const;
|
||||
|
||||
// Type
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the type of this gradient fill
|
||||
/// </summary>
|
||||
gradient_fill &type(gradient_fill_type new_type);
|
||||
|
||||
// Degree
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the angle of the gradient in degrees
|
||||
/// </summary>
|
||||
gradient_fill °ree(double degree);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the angle of the gradient
|
||||
/// </summary>
|
||||
double degree() const;
|
||||
|
||||
// Left
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the distance from the left where the gradient starts.
|
||||
/// </summary>
|
||||
double left() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the distance from the left where the gradient starts.
|
||||
/// </summary>
|
||||
gradient_fill &left(double value);
|
||||
|
||||
// Right
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the distance from the right where the gradient starts.
|
||||
/// </summary>
|
||||
double right() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the distance from the right where the gradient starts.
|
||||
/// </summary>
|
||||
gradient_fill &right(double value);
|
||||
|
||||
// Top
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the distance from the top where the gradient starts.
|
||||
/// </summary>
|
||||
double top() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the distance from the top where the gradient starts.
|
||||
/// </summary>
|
||||
gradient_fill &top(double value);
|
||||
|
||||
// Bottom
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the distance from the bottom where the gradient starts.
|
||||
/// </summary>
|
||||
double bottom() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the distance from the bottom where the gradient starts.
|
||||
/// </summary>
|
||||
gradient_fill &bottom(double value);
|
||||
|
||||
// Stops
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Adds a gradient stop at position with the given color.
|
||||
/// </summary>
|
||||
gradient_fill &add_stop(double position, color stop_color);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Deletes all stops from the gradient.
|
||||
/// </summary>
|
||||
gradient_fill &clear_stops();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns all of the gradient stops.
|
||||
/// </summary>
|
||||
std::unordered_map<double, color> stops() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// Returns true if the gradient is equivalent to other.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const gradient_fill &left, const gradient_fill &right);
|
||||
bool operator==(const gradient_fill &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// Returns true if the gradient is not equivalent to other.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const gradient_fill &left, const gradient_fill &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
bool operator!=(const gradient_fill &right) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The type of gradient
|
||||
/// </summary>
|
||||
gradient_fill_type type_ = gradient_fill_type::linear;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The angle of the gradient
|
||||
/// </summary>
|
||||
double degree_ = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// THe left distance
|
||||
/// </summary>
|
||||
double left_ = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// THe right distance
|
||||
/// </summary>
|
||||
double right_ = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The top distance
|
||||
/// </summary>
|
||||
double top_ = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The bottom distance
|
||||
/// </summary>
|
||||
double bottom_ = 0;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The gradient stops and colors
|
||||
/// </summary>
|
||||
std::unordered_map<double, color> stops_;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Enumerates the possible fill types
|
||||
/// </summary>
|
||||
enum class XLNT_API fill_type
|
||||
{
|
||||
|
@ -347,29 +342,26 @@ public:
|
|||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const fill &left, const fill &right);
|
||||
bool operator==(const fill &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const fill &left, const fill &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
bool operator!=(const fill &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The type of this fill
|
||||
/// </summary>
|
||||
fill_type type_ = fill_type::pattern;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The internal gradient fill if this is a gradient fill type
|
||||
/// </summary>
|
||||
xlnt::gradient_fill gradient_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The internal pattern fill if this is a pattern fill type
|
||||
/// </summary>
|
||||
xlnt::pattern_fill pattern_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -41,7 +41,7 @@ class XLNT_API font
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Text can be underlined in the enumerated ways
|
||||
/// </summary>
|
||||
enum class underline_style
|
||||
{
|
||||
|
@ -53,208 +53,270 @@ public:
|
|||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a default font. Calibri, size 12
|
||||
/// </summary>
|
||||
font();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the bold state of the font to bold and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &bold(bool bold);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the bold state of the font.
|
||||
/// </summary>
|
||||
bool bold() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the vertical alignment of the font to subscript and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &superscript(bool superscript);
|
||||
font &subscript(bool value);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has a vertical alignment of subscript.
|
||||
/// </summary>
|
||||
bool subscript() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the vertical alignment of the font to superscript and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &superscript(bool value);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this font has a vertical alignment of superscript.
|
||||
/// </summary>
|
||||
bool superscript() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the bold state of the font to bold and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &italic(bool italic);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has italics applied.
|
||||
/// </summary>
|
||||
bool italic() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the bold state of the font to bold and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &strikethrough(bool strikethrough);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has a strikethrough applied.
|
||||
/// </summary>
|
||||
bool strikethrough() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the bold state of the font to bold and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &outline(bool outline);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this font has an outline applied.
|
||||
/// </summary>
|
||||
bool outline() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the shadow state of the font to shadow and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &shadow(bool shadow);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this font has a shadow applied.
|
||||
/// </summary>
|
||||
bool shadow() const;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the underline state of the font to new_underline and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &underline(underline_style new_underline);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has any type of underline applied.
|
||||
/// </summary>
|
||||
bool underlined() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the particular style of underline this font has applied.
|
||||
/// </summary>
|
||||
underline_style underline() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has a defined size.
|
||||
/// </summary>
|
||||
bool has_size() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the size of the font to size and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &size(double size);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the size of the font.
|
||||
/// </summary>
|
||||
double size() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has a particular face applied (e.g. "Comic Sans").
|
||||
/// </summary>
|
||||
bool has_name() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the font face to name and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &name(const std::string &name);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the name of the font face.
|
||||
/// </summary>
|
||||
std::string name() const;
|
||||
const std::string &name() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has a color applied.
|
||||
/// </summary>
|
||||
bool has_color() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the color of the font to c and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &color(const color &c);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the color that this font is using.
|
||||
/// </summary>
|
||||
xlnt::color color() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has a family defined.
|
||||
/// </summary>
|
||||
bool has_family() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the family index of the font to family and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &family(std::size_t family);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the family index for the font.
|
||||
/// </summary>
|
||||
std::size_t family() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this font has a charset defined.
|
||||
/// </summary>
|
||||
bool has_charset() const;
|
||||
|
||||
// TODO: charset should be an enum, not a number
|
||||
|
||||
/// <summary>
|
||||
/// Sets the charset of the font to charset and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &charset(std::size_t charset);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the charset of the font.
|
||||
/// </summary>
|
||||
std::size_t charset() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this font has a scheme.
|
||||
/// </summary>
|
||||
bool has_scheme() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the scheme of the font to scheme and returns a reference to the font.
|
||||
/// </summary>
|
||||
font &scheme(const std::string &scheme);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the scheme of this font.
|
||||
/// </summary>
|
||||
std::string scheme() const;
|
||||
const std::string &scheme() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const font &left, const font &right);
|
||||
bool operator==(const font &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const font &left, const font &right)
|
||||
bool operator!=(const font &other) const
|
||||
{
|
||||
return !(left == right);
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
private:
|
||||
friend class style;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The name of the font
|
||||
/// </summary>
|
||||
optional<std::string> name_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// size
|
||||
/// </summary>
|
||||
optional<double> size_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// bold
|
||||
/// </summary>
|
||||
bool bold_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// italic
|
||||
/// </summary>
|
||||
bool italic_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// superscript
|
||||
/// </summary>
|
||||
bool superscript_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// subscript
|
||||
/// </summary>
|
||||
bool subscript_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// strikethrough
|
||||
/// </summary>
|
||||
bool strikethrough_ = false;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// outline
|
||||
/// </summary>
|
||||
bool outline_ = false;
|
||||
|
||||
/// <summary>
|
||||
/// shadow
|
||||
/// </summary>
|
||||
bool shadow_ = false;
|
||||
|
||||
/// <summary>
|
||||
/// underline style
|
||||
/// </summary>
|
||||
underline_style underline_ = underline_style::none;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// color
|
||||
/// </summary>
|
||||
optional<xlnt::color> color_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// family
|
||||
/// </summary>
|
||||
optional<std::size_t> family_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// charset
|
||||
/// </summary>
|
||||
optional<std::size_t> charset_;
|
||||
|
||||
/// <summary>
|
||||
/// scheme
|
||||
/// </summary>
|
||||
optional<std::string> scheme_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -39,10 +39,15 @@ class number_format;
|
|||
class protection;
|
||||
class style;
|
||||
|
||||
template <typename T>
|
||||
class optional;
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct format_impl;
|
||||
struct stylesheet;
|
||||
class xlsx_producer;
|
||||
class xlsx_consumer;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
@ -53,180 +58,176 @@ class XLNT_API format
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the alignment of this format.
|
||||
/// </summary>
|
||||
std::size_t id() const;
|
||||
|
||||
// Alignment
|
||||
class alignment alignment() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the alignment of this format to new_alignment. Applied, which defaults
|
||||
/// to true, determines whether the alignment should be enabled for cells using
|
||||
/// this format.
|
||||
/// </summary>
|
||||
class alignment &alignment();
|
||||
format alignment(const xlnt::alignment &new_alignment, xlnt::optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const class alignment &alignment() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
format alignment(const xlnt::alignment &new_alignment, bool applied);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the alignment of this format should be applied to cells
|
||||
/// using it.
|
||||
/// </summary>
|
||||
bool alignment_applied() const;
|
||||
|
||||
// Border
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the border of this format.
|
||||
/// </summary>
|
||||
class border &border();
|
||||
class border border() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the border of this format to new_border. Applied, which defaults
|
||||
/// to true, determines whether the border should be enabled for cells using
|
||||
/// this format.
|
||||
/// </summary>
|
||||
const class border &border() const;
|
||||
format border(const xlnt::border &new_border, xlnt::optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
format border(const xlnt::border &new_border, bool applied);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the border set for this format should be applied to cells using the format.
|
||||
/// </summary>
|
||||
bool border_applied() const;
|
||||
|
||||
// Fill
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the fill of this format.
|
||||
/// </summary>
|
||||
class fill &fill();
|
||||
class fill fill() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the fill of this format to new_fill. Applied, which defaults
|
||||
/// to true, determines whether the border should be enabled for cells using
|
||||
/// this format.
|
||||
/// </summary>
|
||||
const class fill &fill() const;
|
||||
format fill(const xlnt::fill &new_fill, xlnt::optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
format fill(const xlnt::fill &new_fill, bool applied);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the fill set for this format should be applied to cells using the format.
|
||||
/// </summary>
|
||||
bool fill_applied() const;
|
||||
|
||||
// Font
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the font of this format.
|
||||
/// </summary>
|
||||
class font &font();
|
||||
class font font() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the font of this format to new_font. Applied, which defaults
|
||||
/// to true, determines whether the font should be enabled for cells using
|
||||
/// this format.
|
||||
/// </summary>
|
||||
const class font &font() const;
|
||||
format font(const xlnt::font &new_font, xlnt::optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
format font(const xlnt::font &new_font, bool applied);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the font set for this format should be applied to cells using the format.
|
||||
/// </summary>
|
||||
bool font_applied() const;
|
||||
|
||||
// Number Format
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the number format of this format.
|
||||
/// </summary>
|
||||
class number_format &number_format();
|
||||
class number_format number_format() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the number format of this format to new_number_format. Applied, which defaults
|
||||
/// to true, determines whether the number format should be enabled for cells using
|
||||
/// this format.
|
||||
/// </summary>
|
||||
const class number_format &number_format() const;
|
||||
format number_format(const xlnt::number_format &new_number_format, xlnt::optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
format number_format(const xlnt::number_format &new_number_format, bool applied);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the number_format set for this format should be applied to cells using the format.
|
||||
/// </summary>
|
||||
bool number_format_applied() const;
|
||||
|
||||
// Protection
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the protection of this format.
|
||||
/// </summary>
|
||||
class protection &protection();
|
||||
class protection protection() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const class protection &protection() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
format protection(const xlnt::protection &new_protection, bool applied);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the protection set for this format should be applied to cells using the format.
|
||||
/// </summary>
|
||||
bool protection_applied() const;
|
||||
|
||||
// Style
|
||||
/// <summary>
|
||||
/// Sets the protection of this format to new_protection. Applied, which defaults
|
||||
/// to true, determines whether the protection should be enabled for cells using
|
||||
/// this format.
|
||||
/// </summary>
|
||||
format protection(const xlnt::protection &new_protection, xlnt::optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the pivot table interface is enabled for this format.
|
||||
/// </summary>
|
||||
bool pivot_button() const;
|
||||
|
||||
/// <summary>
|
||||
/// If show is true, a pivot table interface will be displayed for cells using
|
||||
/// this format.
|
||||
/// </summary>
|
||||
void pivot_button(bool show);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this format should add a single-quote prefix for all text values.
|
||||
/// </summary>
|
||||
bool quote_prefix() const;
|
||||
|
||||
/// <summary>
|
||||
/// If quote is true, enables a single-quote prefix for all text values in cells
|
||||
/// using this format (e.g. "abc" will appear as "'abc"). The text will also not
|
||||
/// be stored in sharedStrings when this is enabled.
|
||||
/// </summary>
|
||||
void quote_prefix(bool quote);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this format has a corresponding style applied.
|
||||
/// </summary>
|
||||
bool has_style() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Removes the style from this format if it exists.
|
||||
/// </summary>
|
||||
void clear_style();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the style of this format to a style with the given name.
|
||||
/// </summary>
|
||||
format style(const std::string &name);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the style of this format to new_style.
|
||||
/// </summary>
|
||||
format style(const class style &new_style);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the style of this format. If it has no style, an invalid_parameter
|
||||
/// exception will be thrown.
|
||||
/// </summary>
|
||||
class style style();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the style of this format. If it has no style, an invalid_parameters
|
||||
/// exception will be thrown.
|
||||
/// </summary>
|
||||
const class style style() const;
|
||||
|
||||
private:
|
||||
friend struct detail::stylesheet;
|
||||
friend class detail::xlsx_producer;
|
||||
friend class detail::xlsx_consumer;
|
||||
friend class cell;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a format from an impl pointer.
|
||||
/// </summary>
|
||||
format(detail::format_impl *d);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The internal implementation of this format
|
||||
/// </summary>
|
||||
detail::format_impl *d_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -28,6 +28,7 @@
|
|||
#include <string>
|
||||
|
||||
#include <xlnt/xlnt_config.hpp>
|
||||
#include <xlnt/utils/optional.hpp>
|
||||
|
||||
namespace xlnt {
|
||||
|
||||
|
@ -40,236 +41,232 @@ class XLNT_API number_format
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "General"
|
||||
/// </summary>
|
||||
static const number_format general();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "@"
|
||||
/// </summary>
|
||||
static const number_format text();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "0"
|
||||
/// </summary>
|
||||
static const number_format number();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "00"
|
||||
/// </summary>
|
||||
static const number_format number_00();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "#,##0.00"
|
||||
/// </summary>
|
||||
static const number_format number_comma_separated1();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "0%"
|
||||
/// </summary>
|
||||
static const number_format percentage();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "0.00%"
|
||||
/// </summary>
|
||||
static const number_format percentage_00();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "yyyy-mm-dd"
|
||||
/// </summary>
|
||||
static const number_format date_yyyymmdd2();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "yy-mm-dd"
|
||||
/// </summary>
|
||||
static const number_format date_yymmdd();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "dd/mm/yy"
|
||||
/// </summary>
|
||||
static const number_format date_ddmmyyyy();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "d/m/yy"
|
||||
/// </summary>
|
||||
static const number_format date_dmyslash();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "d-m-yy"
|
||||
/// </summary>
|
||||
static const number_format date_dmyminus();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "d-m"
|
||||
/// </summary>
|
||||
static const number_format date_dmminus();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "m-yy"
|
||||
/// </summary>
|
||||
static const number_format date_myminus();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "mm-dd-yy"
|
||||
/// </summary>
|
||||
static const number_format date_xlsx14();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "d-mmm-yy"
|
||||
/// </summary>
|
||||
static const number_format date_xlsx15();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "d-mmm"
|
||||
/// </summary>
|
||||
static const number_format date_xlsx16();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "mmm-yy"
|
||||
/// </summary>
|
||||
static const number_format date_xlsx17();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "m/d/yy h:mm"
|
||||
/// </summary>
|
||||
static const number_format date_xlsx22();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "yyyy-mm-dd h:mm:ss"
|
||||
/// </summary>
|
||||
static const number_format date_datetime();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "h:mm AM/PM"
|
||||
/// </summary>
|
||||
static const number_format date_time1();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "h:mm:ss AM/PM"
|
||||
/// </summary>
|
||||
static const number_format date_time2();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "h:mm"
|
||||
/// </summary>
|
||||
static const number_format date_time3();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "h:mm:ss"
|
||||
/// </summary>
|
||||
static const number_format date_time4();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "mm:ss"
|
||||
/// </summary>
|
||||
static const number_format date_time5();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Number format "h:mm:ss"
|
||||
/// </summary>
|
||||
static const number_format date_time6();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the given format ID corresponds to a known builtin format.
|
||||
/// </summary>
|
||||
static bool is_builtin_format(std::size_t builtin_id);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the format with the given ID. Thows an invalid_parameter exception
|
||||
/// if builtin_id is not a valid ID.
|
||||
/// </summary>
|
||||
static const number_format &from_builtin_id(std::size_t builtin_id);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a default number_format equivalent to "General"
|
||||
/// </summary>
|
||||
number_format();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a number format equivalent to that returned from number_format::from_builtin_id(builtin_id).
|
||||
/// </summary>
|
||||
number_format(std::size_t builtin_id);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a number format from a code string. If the string matches a builtin ID,
|
||||
/// its ID will also be set to match the builtin ID.
|
||||
/// </summary>
|
||||
number_format(const std::string &code);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a number format from a code string and custom ID. Custom ID should generally
|
||||
/// be >= 164.
|
||||
/// </summary>
|
||||
number_format(const std::string &code, std::size_t custom_id);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the format code of this number format to format_code.
|
||||
/// </summary>
|
||||
void format_string(const std::string &format_code);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the format code of this number format to format_code and the ID to custom_id.
|
||||
/// </summary>
|
||||
void format_string(const std::string &format_code, std::size_t custom_id);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the format code this number format uses.
|
||||
/// </summary>
|
||||
std::string format_string() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this number format has an ID.
|
||||
/// </summary>
|
||||
bool has_id() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the ID of this number format to id.
|
||||
/// </summary>
|
||||
void id(std::size_t id);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the ID of this format.
|
||||
/// </summary>
|
||||
std::size_t id() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns text formatted according to this number format's format code.
|
||||
/// </summary>
|
||||
std::string format(const std::string &text) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns number formatted according to this number format's format code
|
||||
/// with the given base date.
|
||||
/// </summary>
|
||||
std::string format(long double number, calendar base_date) const;
|
||||
std::string format(double number, calendar base_date) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this format code returns a number formatted as a date.
|
||||
/// </summary>
|
||||
bool is_date_format() const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// Returns true if this format is equivalent to other.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const number_format &left, const number_format &right);
|
||||
bool operator==(const number_format &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// Returns true if this format is not equivalent to other.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const number_format &left, const number_format &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
bool operator!=(const number_format &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// The optional ID
|
||||
/// </summary>
|
||||
bool id_set_;
|
||||
optional<std::size_t> id_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::size_t id_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The format code
|
||||
/// </summary>
|
||||
std::string format_string_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -38,71 +38,68 @@ class XLNT_API protection
|
|||
{
|
||||
public:
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns an unlocked and unhidden protection object.
|
||||
/// </summary>
|
||||
static protection unlocked_and_visible();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a locked and unhidden protection object.
|
||||
/// </summary>
|
||||
static protection locked_and_visible();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns an unlocked and hidden protection object.
|
||||
/// </summary>
|
||||
static protection unlocked_and_hidden();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a locked and hidden protection object.
|
||||
/// </summary>
|
||||
static protection locked_and_hidden();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a default unlocked unhidden protection object.
|
||||
/// </summary>
|
||||
protection();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if cells using this protection should be locked.
|
||||
/// </summary>
|
||||
bool locked() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the locked state of the protection to locked and returns a reference to the protection.
|
||||
/// </summary>
|
||||
protection &locked(bool locked);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if cells using this protection should be hidden.
|
||||
/// </summary>
|
||||
bool hidden() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the hidden state of the protection to hidden and returns a reference to the protection.
|
||||
/// </summary>
|
||||
protection &hidden(bool hidden);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is exactly equal to right.
|
||||
/// Returns true if this protections is equivalent to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator==(const protection &left, const protection &right);
|
||||
bool operator==(const protection &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if left is not exactly equal to right.
|
||||
/// Returns true if this protection is not equivalent to right.
|
||||
/// </summary>
|
||||
XLNT_API friend bool operator!=(const protection &left, const protection &right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
bool operator!=(const protection &other) const;
|
||||
|
||||
private:
|
||||
/// <summary>
|
||||
///
|
||||
/// Whether the cell using this protection is locked or not
|
||||
/// </summary>
|
||||
bool locked_;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Whether the cell using this protection is hidden or not
|
||||
/// </summary>
|
||||
bool hidden_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
// Copyright (c) 2010-2015 openpyxl
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@ -15,7 +15,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -44,6 +44,7 @@ namespace detail {
|
|||
|
||||
struct style_impl;
|
||||
struct stylesheet;
|
||||
class xlsx_consumer;
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
@ -60,187 +61,199 @@ public:
|
|||
style() = delete;
|
||||
|
||||
/// <summary>
|
||||
/// Default copy constructor
|
||||
/// Default copy constructor. Constructs a style using the same PIMPL as other.
|
||||
/// </summary>
|
||||
style(const style &other) = default;
|
||||
|
||||
/// <summary>
|
||||
/// Return the name of this style.
|
||||
/// Returns the name of this style.
|
||||
/// </summary>
|
||||
std::string name() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the name of this style to name.
|
||||
/// </summary>
|
||||
style name(const std::string &name);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this style is hidden.
|
||||
/// </summary>
|
||||
bool hidden() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the hidden state of this style to value. A hidden style will not
|
||||
/// be shown in the list of selectable styles in the UI, but will still
|
||||
/// apply its formatting to cells using it.
|
||||
/// </summary>
|
||||
style hidden(bool value);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this is a builtin style that has been customized and
|
||||
/// should therefore be persisted in the workbook.
|
||||
/// </summary>
|
||||
optional<bool> custom() const;
|
||||
bool custom_builtin() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the index of the builtin style that this style is an instance
|
||||
/// of or is a customized version thereof. If style::builtin() is false,
|
||||
/// this will throw an invalid_attribute exception.
|
||||
/// </summary>
|
||||
style custom(bool value);
|
||||
std::size_t builtin_id() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this is a builtin style.
|
||||
/// </summary>
|
||||
optional<std::size_t> builtin_id() const;
|
||||
bool builtin() const;
|
||||
|
||||
// Formatting (xf) components
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the alignment of this style.
|
||||
/// </summary>
|
||||
style builtin_id(std::size_t builtin_id);
|
||||
|
||||
// Formatting components
|
||||
class alignment alignment() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class alignment &alignment();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
const class alignment &alignment() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style alignment(const xlnt::alignment &new_alignment, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the alignment of this style should be applied to cells
|
||||
/// using it.
|
||||
/// </summary>
|
||||
bool alignment_applied() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the alignment of this style to new_alignment. Applied, which defaults
|
||||
/// to true, determines whether the alignment should be enabled for cells using
|
||||
/// this style.
|
||||
/// </summary>
|
||||
class border &border();
|
||||
style alignment(const xlnt::alignment &new_alignment, optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the border of this style.
|
||||
/// </summary>
|
||||
const class border &border() const;
|
||||
class border border() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style border(const xlnt::border &new_border, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the border set for this style should be applied to cells using the style.
|
||||
/// </summary>
|
||||
bool border_applied() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the border of this style to new_border. Applied, which defaults
|
||||
/// to true, determines whether the border should be enabled for cells using
|
||||
/// this style.
|
||||
/// </summary>
|
||||
class fill &fill();
|
||||
style border(const xlnt::border &new_border, optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the fill of this style.
|
||||
/// </summary>
|
||||
const class fill &fill() const;
|
||||
class fill fill() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style fill(const xlnt::fill &new_fill, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the fill set for this style should be applied to cells using the style.
|
||||
/// </summary>
|
||||
bool fill_applied() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the fill of this style to new_fill. Applied, which defaults
|
||||
/// to true, determines whether the border should be enabled for cells using
|
||||
/// this style.
|
||||
/// </summary>
|
||||
class font &font();
|
||||
style fill(const xlnt::fill &new_fill, optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the font of this style.
|
||||
/// </summary>
|
||||
const class font &font() const;
|
||||
class font font() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style font(const xlnt::font &new_font, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the font set for this style should be applied to cells using the style.
|
||||
/// </summary>
|
||||
bool font_applied() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the font of this style to new_font. Applied, which defaults
|
||||
/// to true, determines whether the font should be enabled for cells using
|
||||
/// this style.
|
||||
/// </summary>
|
||||
class number_format &number_format();
|
||||
style font(const xlnt::font &new_font, optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the number_format of this style.
|
||||
/// </summary>
|
||||
const class number_format &number_format() const;
|
||||
class number_format number_format() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style number_format(const xlnt::number_format &new_number_format, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the number_format set for this style should be applied to cells using the style.
|
||||
/// </summary>
|
||||
bool number_format_applied() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the number format of this style to new_number_format. Applied, which defaults
|
||||
/// to true, determines whether the number format should be enabled for cells using
|
||||
/// this style.
|
||||
/// </summary>
|
||||
class protection &protection();
|
||||
style number_format(const xlnt::number_format &new_number_format, optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns the protection of this style.
|
||||
/// </summary>
|
||||
const class protection &protection() const;
|
||||
class protection protection() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
style protection(const xlnt::protection &new_protection, bool applied = true);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if the protection set for this style should be applied to cells using the style.
|
||||
/// </summary>
|
||||
bool protection_applied() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Sets the border of this style to new_protection. Applied, which defaults
|
||||
/// to true, determines whether the protection should be enabled for cells using
|
||||
/// this style.
|
||||
/// </summary>
|
||||
style protection(const xlnt::protection &new_protection, optional<bool> applied = {});
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the pivot table interface is enabled for this style.
|
||||
/// </summary>
|
||||
bool pivot_button() const;
|
||||
|
||||
/// <summary>
|
||||
/// If show is true, a pivot table interface will be displayed for cells using
|
||||
/// this style.
|
||||
/// </summary>
|
||||
void pivot_button(bool show);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this style should add a single-quote prefix for all text values.
|
||||
/// </summary>
|
||||
bool quote_prefix() const;
|
||||
|
||||
/// <summary>
|
||||
/// If quote is true, enables a single-quote prefix for all text values in cells
|
||||
/// using this style (e.g. "abc" will appear as "'abc"). The text will also not
|
||||
/// be stored in sharedStrings when this is enabled.
|
||||
/// </summary>
|
||||
void quote_prefix(bool quote);
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this style is equivalent to other.
|
||||
/// </summary>
|
||||
bool operator==(const style &other) const;
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this style is not equivalent to other.
|
||||
/// </summary>
|
||||
bool operator!=(const style &other) const;
|
||||
|
||||
private:
|
||||
friend struct detail::stylesheet;
|
||||
friend class detail::xlsx_consumer;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a style from an impl pointer.
|
||||
/// </summary>
|
||||
style(detail::style_impl *d);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The internal implementation of this style
|
||||
/// </summary>
|
||||
detail::style_impl *d_;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -49,7 +49,7 @@ struct XLNT_API date
|
|||
static date from_number(int days_since_base_year, calendar base_date);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a data from a given year, month, and day.
|
||||
/// </summary>
|
||||
date(int year_, int month_, int day_);
|
||||
|
||||
|
@ -59,7 +59,8 @@ struct XLNT_API date
|
|||
int to_number(calendar base_date) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Calculates and returns the day of the week that this date represents in the range
|
||||
/// 0 to 6 where 0 represents Sunday.
|
||||
/// </summary>
|
||||
int weekday() const;
|
||||
|
||||
|
@ -69,17 +70,22 @@ struct XLNT_API date
|
|||
bool operator==(const date &comparand) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Return true if this date is equal to comparand.
|
||||
/// </summary>
|
||||
bool operator!=(const date &comparand) const;
|
||||
|
||||
/// <summary>
|
||||
/// The year
|
||||
/// </summary>
|
||||
int year;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The month
|
||||
/// </summary>
|
||||
int month;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The day
|
||||
/// </summary>
|
||||
int day;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2014-2016 Thomas Fussell
|
||||
// Copyright (c) 2014-2021 Thomas Fussell
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -14,7 +14,7 @@
|
|||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, WRISING FROM,
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE
|
||||
//
|
||||
|
@ -39,95 +39,96 @@ struct time;
|
|||
struct XLNT_API datetime
|
||||
{
|
||||
/// <summary>
|
||||
/// Return the current date and time according to the system time.
|
||||
/// Returns the current date and time according to the system time.
|
||||
/// </summary>
|
||||
static datetime now();
|
||||
|
||||
/// <summary>
|
||||
/// Return the current date and time according to the system time.
|
||||
/// Returns the current date and time according to the system time.
|
||||
/// This is equivalent to datetime::now().
|
||||
/// </summary>
|
||||
static datetime today();
|
||||
|
||||
/// <summary>
|
||||
/// Return a datetime from number by converting the integer part into
|
||||
/// Returns a datetime from number by converting the integer part into
|
||||
/// a date and the fractional part into a time according to date::from_number
|
||||
/// and time::from_number.
|
||||
/// </summary>
|
||||
static datetime from_number(long double number, calendar base_date);
|
||||
static datetime from_number(double number, calendar base_date);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a datetime equivalent to the ISO-formatted string iso_string.
|
||||
/// </summary>
|
||||
static datetime from_iso_string(const std::string &iso_string);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a datetime from a date and a time.
|
||||
/// </summary>
|
||||
datetime(const date &d, const time &t);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructs a datetime from a year, month, and day plus optional hour, minute, second, and microsecond.
|
||||
/// </summary>
|
||||
datetime(int year_, int month_, int day_, int hour_ = 0, int minute_ = 0, int second_ = 0, int microsecond_ = 0);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns a string represenation of this date and time.
|
||||
/// </summary>
|
||||
std::string to_string() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns an ISO-formatted string representation of this date and time.
|
||||
/// </summary>
|
||||
std::string to_iso_string() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns this datetime as a number of seconds since 1900 or 1904 (depending on base_date provided).
|
||||
/// </summary>
|
||||
long double to_number(calendar base_date) const;
|
||||
double to_number(calendar base_date) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Returns true if this datetime is equivalent to comparand.
|
||||
/// </summary>
|
||||
bool operator==(const datetime &comparand) const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Calculates and returns the day of the week that this date represents in the range
|
||||
/// 0 to 6 where 0 represents Sunday.
|
||||
/// </summary>
|
||||
int weekday() const;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The year
|
||||
/// </summary>
|
||||
int year;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The month
|
||||
/// </summary>
|
||||
int month;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The day
|
||||
/// </summary>
|
||||
int day;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The hour
|
||||
/// </summary>
|
||||
int hour;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The minute
|
||||
/// </summary>
|
||||
int minute;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The second
|
||||
/// </summary>
|
||||
int second;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// The microsecond
|
||||
/// </summary>
|
||||
int microsecond;
|
||||
};
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue