Compare commits
573 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 25c3ba7338 | |||
| eafd18dac0 | |||
| b70b31226b | |||
| 28a5bcdf8e | |||
| ec2a41b86b | |||
| 5556821e7e | |||
| 44c73fdd5b | |||
| 80080d9fde | |||
| 280addd21c | |||
| 483d0ef6fe | |||
| 0ff0359524 | |||
| b038f4130c | |||
| 2d83e86f07 | |||
| 871ab6df64 | |||
| df7ee72171 | |||
| 2e37667371 | |||
| b5b00f7aff | |||
| f7908335e5 | |||
| f43c6906ff | |||
| 3071cc847c | |||
| 5c464e0746 | |||
| 484c724ac6 | |||
| 6bed2e663e | |||
| ffea3da872 | |||
| ee34d09f7a | |||
| 948f284472 | |||
| b92b54de0e | |||
| 50d22e2bb7 | |||
| 071e7f3dfa | |||
| ce0a3dd526 | |||
| 9e7b5f6444 | |||
| ca5d22ebca | |||
| 3d0db63193 | |||
| 924dfe29c8 | |||
| d95f56b39b | |||
| a479197f0b | |||
| c828c5d1d1 | |||
| be93298afd | |||
| 06131ce8b5 | |||
| 66600f9f1f | |||
| 3ae8f3d57a | |||
| af41a9dcef | |||
| 7ecdb0236b | |||
| 6c7187b54f | |||
| 011b6cdfbf | |||
| 857190a20a | |||
| 37af704998 | |||
| f2d60d7abe | |||
| 54948b441d | |||
| 28d5539fc7 | |||
| bde82f19cb | |||
| 123aee6b1b | |||
| 4e9fe02b9a | |||
| cb108249f2 | |||
| a8ce12f2b4 | |||
| 8ddecd21a1 | |||
| 520dd7b2b7 | |||
| 5afe1e64f8 | |||
| 2d5bb51734 | |||
| 44bb16cae7 | |||
| 2d2684cc3d | |||
| af014a1bb4 | |||
| 75151b2987 | |||
| 736ffd0140 | |||
| acb3f4a8f9 | |||
| 54d25bcabc | |||
| f0e70e68e0 | |||
| 0df300cee6 | |||
| df142c35aa | |||
| 00887c4f3a | |||
| a26610b315 | |||
| 5400e01651 | |||
| c783f818a8 | |||
| 5ea8399ada | |||
| 0bc707ad34 | |||
| 22309af65c | |||
| 2c7e0f044b | |||
| cd5209f264 | |||
| 098f19f706 | |||
| 08e4191e5a | |||
| 79412d205b | |||
| 27f6c9081c | |||
| cdb990e810 | |||
| 489e429b5c | |||
| d80cd13d41 | |||
| 41395f2051 | |||
| 08cf89d1c9 | |||
| 90a4f9ecb0 | |||
| 53ba534677 | |||
| 8504bc8988 | |||
| 69674d706f | |||
| ca1a25d6d6 | |||
| 46909c6fb8 | |||
| 6a1929a6d6 | |||
| 5b872b59a1 | |||
| fe4a734a9d | |||
| 4d201c8f0e | |||
| c8eefab345 | |||
| aeb83b3c05 | |||
| 45ca23d074 | |||
| e4f36afcb3 | |||
| 0b2268a921 | |||
| 36d432e2cc | |||
| c5489e0f0a | |||
| ad2e866332 | |||
| ced9c0dd4f | |||
| 1f78dac7b5 | |||
| e2a141785f | |||
| 97ca7d9818 | |||
| 48d91d6dd8 | |||
| 0b1b7ccc62 | |||
| 0d75ff1542 | |||
| 3b83367c4a | |||
| 9b2e4b4975 | |||
| 7106c697d0 | |||
| 1844fdd443 | |||
| 0257c40bc4 | |||
| f413a569b3 | |||
| ba99bc5da4 | |||
| 05b7ad0e9c | |||
| f7689115ae | |||
| c270a8ac66 | |||
| c93db04d9e | |||
| 4227a6d11b | |||
| 428340a974 | |||
| c7e74a68a7 | |||
| 6c583d82f2 | |||
| 243b42f4cb | |||
| 275ece0bb2 | |||
| d018b3f8fb | |||
| 5e42f6a48d | |||
| 6ab89664c6 | |||
| 5379378626 | |||
| 5b2987bd07 | |||
| 67cdd23918 | |||
| 11fecb1558 | |||
| c2bd7d3543 | |||
| f8de1c60b4 | |||
| 0a2362dd57 | |||
| 25e3cb0144 | |||
| f507ee449b | |||
| c72a707fca | |||
| 2709d2a595 | |||
| 478f8a0c76 | |||
| cf9bb8bb16 | |||
| 6eafca89e3 | |||
| 676a3c3d0d | |||
| 3a5b565bd8 | |||
| 478292b9ec | |||
| 9cf380810a | |||
| 1111f8da7c | |||
| 87d21a643d | |||
| 9a12579cb9 | |||
| ee512ebc00 | |||
| 8fe33581e6 | |||
| 909d581265 | |||
| 09f3e6738c | |||
| 9e6e2f474f | |||
| 9a81201b24 | |||
| 3084c48c8e | |||
| 5409b12e6e | |||
| e95d3cbdc9 | |||
| 4718c46170 | |||
| b65451c2b4 | |||
| 501c6273a3 | |||
| 5aa00ca0ad | |||
| 0cfa5ba5fe | |||
| b433350aff | |||
| 01777cb320 | |||
| e221cfd47a | |||
| 34eafe127e | |||
| 4daf8d3b38 | |||
| 99dee32e84 | |||
| e366824b74 | |||
| 9e58650477 | |||
| 4ef209cabe | |||
| f6f919d229 | |||
| 503ef79cea | |||
| c7c068be6e | |||
| 06e0fb4c19 | |||
| 4b0259b57f | |||
| 70be188426 | |||
| fce385dd73 | |||
| 3ea894029f | |||
| 70a7480601 | |||
| 873fa449ce | |||
| 498968b89c | |||
| 1683f271c6 | |||
| f8662d75eb | |||
| f1c7d91a74 | |||
| 2096d0bd86 | |||
| 529aae0238 | |||
| d97c7cc95c | |||
| 3a6c75f5bd | |||
| 93f1cf717b | |||
| 58d319511a | |||
| 6a597a9277 | |||
| 5686d0a713 | |||
| 5e63985fa7 | |||
| 88d21ce70e | |||
| 55d0e2b3ac | |||
| 6fd6558040 | |||
| 7f6c39c358 | |||
| 06c46bd352 | |||
| 5ba4feac59 | |||
| fa67c65da9 | |||
| 0334c145d0 | |||
| 50d1dec4e0 | |||
| e806592d92 | |||
| 129d64dd87 | |||
| adb327d98e | |||
| 7023e83843 | |||
| a09de19764 | |||
| 08aeb5d65b | |||
| 4b1ce402ff | |||
| 31ed7d2b67 | |||
| 0e7460496e | |||
| c9fffa6789 | |||
| e8aeffc096 | |||
| 54535e072e | |||
| 2386ff1abc | |||
| 98c9bca45a | |||
| 02d31f0457 | |||
| f4bfbb47fa | |||
| d08a7f1c0d | |||
| 529c624afc | |||
| 5abf4da75e | |||
| 2172e82f23 | |||
| d7b735ff95 | |||
| fd2e4b1397 | |||
| b8c6d59ab6 | |||
| 06a9c56656 | |||
| 777726f093 | |||
| c5ff1b4550 | |||
| fdd7dac561 | |||
| d5f9059199 | |||
| a431ccc156 | |||
| 2796296a24 | |||
| ac21faf35e | |||
| 68084b64c9 | |||
| a94382dd07 | |||
| 4ff8998198 | |||
| e28f54f598 | |||
| 879c083abf | |||
| 36b263a906 | |||
| bbea8ace72 | |||
| 171389d9d3 | |||
| 65d166f356 | |||
| 909cd46a9f | |||
| f3186f4dc0 | |||
| e3874a1973 | |||
| 8df09d92c0 | |||
| b72f83136c | |||
| 7bb4bacc11 | |||
| 855d76bb40 | |||
| e4b6b32f11 | |||
| ae0946ac9d | |||
| da4832fb50 | |||
| 0e6d4aa1d7 | |||
| e278d22d42 | |||
| 5e75a3ece9 | |||
| 8496d25279 | |||
| a89c7eedcf | |||
| bdb817a6a1 | |||
| 0bfc4ac41e | |||
| aef287cbb6 | |||
| 906edf7078 | |||
| 50e4864efb | |||
| 87f88bba30 | |||
| c995a331b6 | |||
| 41ce37233d | |||
| 2b90740855 | |||
| 96b76b4e41 | |||
| 3f918a5d35 | |||
| 7595a83f36 | |||
| d9cf2b65b5 | |||
| 2a56489feb | |||
| 325dd3b701 | |||
| 7bc525f885 | |||
| 667b841de1 | |||
| 8275916601 | |||
| 9462c7bfb3 | |||
| 981daca351 | |||
| 1e56392c5c | |||
| 6e090a2dad | |||
| d0c7b427ff | |||
| 9fad915d0e | |||
| b82505e86c | |||
| 546a43b8b8 | |||
| 558659d117 | |||
| 62c222c211 | |||
| 45401513b4 | |||
| f4fe303829 | |||
| f7b4372108 | |||
| b23d580941 | |||
| 51b5870953 | |||
| 33aeb38f0c | |||
| 4b2131f501 | |||
| 806e3e9eb0 | |||
| 8d3a2e93fd | |||
| f17c46f8ec | |||
| 7d811f2ab2 | |||
| e89fcf29f7 | |||
| 911d82f99b | |||
| 557f45587f | |||
| 90f9996fdb | |||
| 8f3d9d9cdf | |||
| 98d64f9939 | |||
| 084003e361 | |||
| cab1261a42 | |||
| b460e85abe | |||
| ca8bfc6180 | |||
| 331e51cdfc | |||
| 02df83e19d | |||
| 9a09e8e321 | |||
| 6af8e0b380 | |||
| f3c043195f | |||
| e2e75f1039 | |||
| 78f29138bc | |||
| b5b9913293 | |||
| 78447d9800 | |||
| 23297f5045 | |||
| 1b16eeeeb9 | |||
| 46f4014647 | |||
| 17c8da0244 | |||
| 4323840e8e | |||
| 8912dfd7e1 | |||
| 661bdd999a | |||
| 372959ddee | |||
| ca4a8cd200 | |||
| c78b483dd5 | |||
| d33b4b38f7 | |||
| 5467173e01 | |||
| 94fb19d9be | |||
| 68f083a6d1 | |||
| 3a8de56ee5 | |||
| 9780cf931f | |||
| 6282dd48bb | |||
| c64f06c3ad | |||
| 96ca8a43a6 | |||
| 01da3ddd35 | |||
| e187e696b5 | |||
| cb38761213 | |||
| 6817ec7a78 | |||
| b93b67f1b6 | |||
| 365af33fc6 | |||
| 85776dd66b | |||
| 432583bb20 | |||
| b3f3bf5c0a | |||
| 0a50bad4c0 | |||
| 5e06ae1b4d | |||
| bc696ad89b | |||
| 1c816da43b | |||
| 8fe4d67abe | |||
| ffc6f840bd | |||
| 532354c2a4 | |||
| 9bae342c0d | |||
| 072f0b0fa3 | |||
| 6395af4113 | |||
| c2592271e8 | |||
| ce8584c728 | |||
| d2c306ce6a | |||
| abc8bb9849 | |||
| 8398ac7a81 | |||
| 8e202d6aaf | |||
| 960434f7e5 | |||
| c4213b21ad | |||
| 99c24f1c2b | |||
| 6aff735482 | |||
| e82b81c8c0 | |||
| 5e6fd1aeda | |||
| 090a5a6995 | |||
| eba0450647 | |||
| 10f5cb7479 | |||
| ec0a78280b | |||
| 9c1454385e | |||
| c0c561d6b1 | |||
| 6c2a2116f7 | |||
| 4a6991b771 | |||
| f34f15dc60 | |||
| bae76a4dc0 | |||
| 51ffac77cf | |||
| 17e8092643 | |||
| 9ff4a40bc2 | |||
| 04c466260c | |||
| 5cc7d1a869 | |||
| b08a0f87d6 | |||
| 9d232222df | |||
| 1f57d10bdd | |||
| 3d7db8fb83 | |||
| bbb15ea940 | |||
| 33dd8e2f45 | |||
| f90e73f64b | |||
| fc5e6dcf8b | |||
| b215adf723 | |||
| db00a9b8e2 | |||
| 60c8c51d49 | |||
| e8e5fc79ea | |||
| efbe579e25 | |||
| 5264cb1f9e | |||
| ef10f20351 | |||
| cbe93b3b56 | |||
| 32712dcd8e | |||
| 703d9ebd12 | |||
| 2b1a3aedbe | |||
| 99f27f1a56 | |||
| a940181998 | |||
| 1ac117f1c8 | |||
| abf9762abb | |||
| b82408c545 | |||
| dbd72f9c60 | |||
| 584472f779 | |||
| 8b36da6782 | |||
| 17533deb50 | |||
| 871ee4ca32 | |||
| 582eae5ba3 | |||
| 6d238a93e1 | |||
| d52260b2f4 | |||
| 65b7b5d4bd | |||
| b3e8ed7814 | |||
| f2af5b7e7f | |||
| e38a8d8eeb | |||
| f67b854aad | |||
| f45408053c | |||
| 8b759af395 | |||
| e26a47d96c | |||
| 4d5ad23cce | |||
| 5349b819b0 | |||
| 9d61aeb04b | |||
| b18a3b3536 | |||
| 68bb3b2af7 | |||
| f7e6b94aba | |||
| 0b14e8e24b | |||
| 861470c6ac | |||
| e1a3b1cbe7 | |||
| 274cd094d8 | |||
| 42cf50cc57 | |||
| 94750baa6b | |||
| a01cab21cc | |||
| d8d32c1b3a | |||
| dc2aec50d4 | |||
| df2df0905d | |||
| 633817ceac | |||
| 9be5c97fcf | |||
| 4393f3bd72 | |||
| 75c8749189 | |||
| 247e725ad3 | |||
| 8e00addabf | |||
| d712537638 | |||
| 7a266b1d78 | |||
| e77f181393 | |||
| cfb1810d92 | |||
| 0d48351c9e | |||
| 919f5fd265 | |||
| 140de440cc | |||
| 17f01bb88c | |||
| 406c3ba42c | |||
| 68b754effd | |||
| b3fd31b108 | |||
| 20a4dc3839 | |||
| ab60695ef9 | |||
| df5c75d6b0 | |||
| 4d80f3ec28 | |||
| 5a3fafcc55 | |||
| cf0412b7e2 | |||
| a539e5e460 | |||
| a2c5788a98 | |||
| 796f5b1cfd | |||
| 05707c61fb | |||
| a41159a043 | |||
| c3348bc823 | |||
| 9f25cb9d40 | |||
| 5d26e2f0f6 | |||
| 91017606aa | |||
| af4ed78c01 | |||
| b9ab71e606 | |||
| 16906e93db | |||
| b3147b6b11 | |||
| 09944fde79 | |||
| 7994e411b7 | |||
| 3db74dee60 | |||
| 370c9bc1c7 | |||
| a678d8ec7f | |||
| 014edacf1b | |||
| cbeb67b509 | |||
| 5bf0e30676 | |||
| 695cb49345 | |||
| a9f8993237 | |||
| 3e37cbcfc0 | |||
| 39d39f34c3 | |||
| 702eb9f5af | |||
| 864cde5aed | |||
| c32628c61c | |||
| e4881dd92f | |||
| 948916b888 | |||
| edf1c82b9f | |||
| c60dadf147 | |||
| 1a2cd1befc | |||
| 0c71c05c06 | |||
| c64ed630cd | |||
| 673f6664bd | |||
| 94d893bbe6 | |||
| 9b4f336eba | |||
| 1d38352607 | |||
| aa7b8f977c | |||
| 26995b7f67 | |||
| 001bab4439 | |||
| 80449715c6 | |||
| 5a6af2e41f | |||
| 02bbc77f3c | |||
| 9fdbbe44ee | |||
| 0f6d00d2a5 | |||
| 06ad520851 | |||
| 8547e798fb | |||
| 2ce0323b8f | |||
| abc6b9e7d0 | |||
| 2150afc470 | |||
| b864ccda60 | |||
| b15f3c1155 | |||
| 8fa48b25b4 | |||
| ba03cf1ed6 | |||
| 499742eea2 | |||
| 550786e6b0 | |||
| 5194dfc18a | |||
| 902079af20 | |||
| ca286fb5be | |||
| b23491901f | |||
| 2aa8f133f3 | |||
| c384a52fa5 | |||
| 155edc0f53 | |||
| 27806651b4 | |||
| b06bafe3cd | |||
| 7205191f81 | |||
| 4b98ebe4f2 | |||
| 09ab65ce1a | |||
| d15d9948bc | |||
| 015896f4e4 | |||
| 5b6a0b1852 | |||
| cfe0d9ffac | |||
| 914f6bec44 | |||
| 93830929ae | |||
| 4bc92384b7 | |||
| 7051848d10 | |||
| 59724846e3 | |||
| 86048e7482 | |||
| 0da017a6f9 | |||
| 82927817b8 | |||
| 11f6f498ab | |||
| a3ebead67f | |||
| 0c5746fe7a | |||
| b9129f4453 | |||
| 3e1741dfea | |||
| c2d8077d96 | |||
| 465bd7ef5c | |||
| eb58e2e343 | |||
| 4f955a8b2a | |||
| a63cbd7057 | |||
| 7387fc2210 | |||
| 7d1e05f21d | |||
| ea9cdfd962 | |||
| 692d40916a | |||
| 02479a1528 | |||
| 415fa0a415 | |||
| a8d8d59f2e | |||
| c4da72f55e | |||
| ff1932d550 | |||
| ece6353bd7 | |||
| acf9827891 | |||
| 780c49b6f0 | |||
| 545dadab4d | |||
| 3f85cf14d3 | |||
| 4be6a64abb | |||
| e86fbd0689 |
+76
-49
@@ -1,22 +1,22 @@
|
||||
# Generated from CLion C/C++ Code Style settings
|
||||
# --- Based on Qt Coding Style ---
|
||||
BasedOnStyle: LLVM
|
||||
|
||||
# --- Bracket and Indentation Behavior ---
|
||||
IndentWidth: 4
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
TabWidth: 4
|
||||
ColumnLimit: 100
|
||||
UseTab: Never
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignOperands: DontAlign
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
|
||||
AlignAfterOpenBracket: BlockIndent
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BinPackArguments: false
|
||||
BreakBeforeBraces: Custom
|
||||
BreakTemplateDeclarations: Yes
|
||||
BreakBeforeBinaryOperators: All
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
@@ -31,41 +31,68 @@ BraceWrapping:
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakInheritanceList: BeforeColon
|
||||
ColumnLimit: 100
|
||||
CompactNamespaces: false
|
||||
ContinuationIndentWidth: 4
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
InsertBraces: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PackConstructorInitializers: Never
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: Never
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: false
|
||||
|
||||
# --- Special: Lambdas and Short Things ---
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLambdasOnASingleLine: Inline
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
|
||||
# --- Spaces ---
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceAfterCStyleCast: false
|
||||
Cpp11BracedListStyle: true
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeInheritanceColon: false
|
||||
|
||||
# --- Alignment & Formatting Tweaks ---
|
||||
AlignConsecutiveAssignments:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: true
|
||||
AlignConsecutiveDeclarations:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: true
|
||||
AlignOperands: DontAlign
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
PointerAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
|
||||
# --- Comment Style ---
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
|
||||
# --- Namespace handling ---
|
||||
NamespaceIndentation: None
|
||||
|
||||
# --- Others ---
|
||||
SortIncludes: Never
|
||||
IncludeBlocks: Preserve
|
||||
MaxEmptyLinesToKeep: 2
|
||||
IndentCaseLabels: true
|
||||
InsertBraces: true
|
||||
AlignEscapedNewlines: DontAlign
|
||||
PPIndentWidth: 1
|
||||
IndentPPDirectives: AfterHash
|
||||
ReflowComments: true
|
||||
|
||||
# --- Penalties (Fine-tuning when to break lines) ---
|
||||
PenaltyBreakAssignment: 80
|
||||
PenaltyBreakBeforeFirstCallParameter: 1
|
||||
PenaltyBreakComment: 60
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakOpenParenthesis: 5
|
||||
PenaltyExcessCharacter: 10
|
||||
PenaltyReturnTypeOnItsOwnLine: 600
|
||||
|
||||
@@ -102,4 +102,6 @@ c5c2ea3498f402c0c89916c46ddb071e22756622 # Assembly: Final application of pre-co
|
||||
d472927bba7b2d8d151c99fb29cf1d8dd099ea7d # Correct PartDesign Helix feature negative angles (#11399)
|
||||
b93c02e07da4990482b9d927506901e6f5d624e1 # Black updated to 24.3.0
|
||||
cbea6b60942f8327e6105b12e8c1d5db4647984c # FEM: Apply pre-commit to FEM files
|
||||
f9d66096878c7d89c273522b9ca57bdb14fee3bc # Rearranged CommandCreateGeo.cpp
|
||||
f9d66096878c7d89c273522b9ca57bdb14fee3bc # Rearranged CommandCreateGeo.cpp
|
||||
b23d5809414d63ea90bcc744212c126645051438 # BIM: add to pre-commit and apply Black formatting
|
||||
50e4864efb06faf3e2126e8cb9ff9058a08a54b2 # Draft: add to pre-commit and apply Black formatting
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: FreeCAD
|
||||
liberapay: FreeCAD
|
||||
open_collective: freecad
|
||||
patreon: # Replace with a single Patreon username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
"owner": "msvc-problem-matcher",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp":
|
||||
"^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
||||
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
logdir: /tmp/log/
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
done
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-Logs
|
||||
path: |
|
||||
|
||||
@@ -21,13 +21,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: '🧹 Tag & close stale unconfirmed bugs'
|
||||
id: stale_issues
|
||||
uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
|
||||
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-issue-stale: 60
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
|
||||
- name: '🧹 Close stale requested feedback issues'
|
||||
id: awaiting_issues
|
||||
uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
|
||||
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-issue-stale: 20
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
|
||||
- name: '🧹 Tag & close inactive issues'
|
||||
id: inactive_issues
|
||||
uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
|
||||
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-issue-stale: 190
|
||||
@@ -110,7 +110,7 @@ jobs:
|
||||
|
||||
- name: '🧹 Tag & close inactive PRs'
|
||||
id: inactive_pr
|
||||
uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
|
||||
uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-issue-stale: -1
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Create backport pull requests
|
||||
uses: korthout/backport-action@ca4972adce8039ff995e618f5fc02d1b7961f27a # v3.3.0
|
||||
uses: korthout/backport-action@d07416681cab29bf2661702f925f020aaa962997 # v3.4.1
|
||||
with:
|
||||
# Inputs documented here: https://github.com/korthout/backport-action?tab=readme-ov-file#inputs
|
||||
github_token: ${{ github.token }}
|
||||
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -156,7 +156,7 @@ jobs:
|
||||
sarif_file: sarif-results/cpp.sarif
|
||||
|
||||
- name: Upload loc as a Build Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: sarif-results
|
||||
path: sarif-results
|
||||
|
||||
@@ -17,11 +17,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
- name: 'Checkout Repository'
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4
|
||||
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Fedora Daily Build
|
||||
permissions:
|
||||
contents: read
|
||||
on:
|
||||
schedule:
|
||||
- cron: "00 00 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
trigger-copr-build:
|
||||
env:
|
||||
copr_token: ${{ secrets.COPR_TOKEN }}
|
||||
runs-on: ubuntu-latest
|
||||
container: quay.io/packit/packit
|
||||
steps:
|
||||
- name: setup copr token
|
||||
run: |
|
||||
mkdir -p ~/.config
|
||||
echo "$copr_token" > ~/.config/copr
|
||||
- name: checkout sources
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 500
|
||||
fetch-tags: true
|
||||
- name: Setup safe Git directory
|
||||
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||
- name: trigger copr build
|
||||
run: |
|
||||
packit build in-copr --project freecad
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Fetch Crowdin Translations
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * 1"
|
||||
|
||||
jobs:
|
||||
update-crowdin:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Qt ≥ 6.8
|
||||
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
|
||||
with:
|
||||
aqtversion: "==3.1.*"
|
||||
version: "6.8.3"
|
||||
host: "linux"
|
||||
target: "desktop"
|
||||
arch: "linux_gcc_64"
|
||||
|
||||
- name: Setup Python & dependencies
|
||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
|
||||
with:
|
||||
python-version: "3.13"
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
pip install pyside6
|
||||
|
||||
- name: Gather translations from crowdin
|
||||
run: |
|
||||
./updatecrowdin.py build
|
||||
while ./updatecrowdin.py build-status | grep -q "status: inProgress"; do sleep 10; done
|
||||
./updatecrowdin.py download
|
||||
./updatecrowdin.py install
|
||||
working-directory: ./src/Tools
|
||||
env:
|
||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
|
||||
CROWDIN_PROJECT_ID: freecad
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --global user.name "github-actions"
|
||||
git config --global user.email "github-actions@github.com"
|
||||
git add src
|
||||
git commit -m "Update translations from Crowdin" || echo "No changes to commit"
|
||||
|
||||
- name: Push changes to a new branch
|
||||
run: |
|
||||
git branch update-crowdin-translations
|
||||
git push origin update-crowdin-translations --force
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
|
||||
with:
|
||||
branch: update-crowdin-translations
|
||||
title: "Update translations from Crowdin"
|
||||
body: "Automatic Crowdin update."
|
||||
labels: "translations, automated"
|
||||
delete-branch: true
|
||||
add-paths: |
|
||||
src
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -35,13 +35,13 @@ jobs:
|
||||
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Run issue-metrics tool
|
||||
uses: github/issue-metrics@c2ad23cdf3192065f868ff0ece4e91e4077a4f73 # v3.23.3
|
||||
uses: github/issue-metrics@637a24e71b78bc10881e61972b19ea9ff736e14a # v3.25.2
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SEARCH_QUERY: 'repo:FreeCAD/FreeCAD is:issue created:${{ env.last_month }}'
|
||||
|
||||
- name: Create issue
|
||||
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5.0.1
|
||||
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0
|
||||
with:
|
||||
title: Monthly issue metrics report
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
name: Push Crowdin Translations
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * 1"
|
||||
|
||||
jobs:
|
||||
update-crowdin:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Qt ≥ 6.8
|
||||
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
|
||||
with:
|
||||
aqtversion: "==3.1.*"
|
||||
version: "6.8.3"
|
||||
host: "linux"
|
||||
target: "desktop"
|
||||
arch: "linux_gcc_64"
|
||||
|
||||
- name: Setup Python & dependencies
|
||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
|
||||
with:
|
||||
python-version: "3.13"
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
pip install pyside6
|
||||
|
||||
- name: Push translations to Crowdin
|
||||
run: |
|
||||
./updatecrowdin.py gather
|
||||
./updatecrowdin.py upload
|
||||
working-directory: ./src/Tools
|
||||
env:
|
||||
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
|
||||
CROWDIN_PROJECT_ID: freecad
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
|
||||
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -116,15 +116,15 @@ jobs:
|
||||
mkdir -p ${{ env.reportdir }}
|
||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: prefix-dev/setup-pixi@194d461b21b6c5717c722ffc597fa91ed2ff29fa # v0.9.1
|
||||
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
|
||||
with:
|
||||
pixi-version: v0.48.1
|
||||
pixi-version: v0.59.0
|
||||
cache: false
|
||||
|
||||
- name: Restore Compiler Cache
|
||||
id: cache-restore
|
||||
if: always()
|
||||
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
@@ -209,14 +209,14 @@ jobs:
|
||||
- name: Save Compiler Cache
|
||||
id: cache-save
|
||||
if: always()
|
||||
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-${{ matrix.os }}-Logs
|
||||
path: |
|
||||
@@ -225,7 +225,7 @@ jobs:
|
||||
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
- name: Restore Compiler Cache
|
||||
id: cache-restore
|
||||
if: always()
|
||||
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
@@ -216,14 +216,14 @@ jobs:
|
||||
- name: Save Compiler Cache
|
||||
id: cache-save
|
||||
if: always()
|
||||
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
@@ -232,7 +232,7 @@ jobs:
|
||||
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
- name: Restore compiler cache
|
||||
id: cache-restore
|
||||
if: always()
|
||||
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
@@ -157,14 +157,14 @@ jobs:
|
||||
- name: Save Compiler Cache
|
||||
id: cache-save
|
||||
if: always()
|
||||
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }}
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
|
||||
@@ -198,7 +198,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -355,7 +355,7 @@ jobs:
|
||||
|
||||
- name: Upload logs and fixes
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
@@ -364,7 +364,7 @@ jobs:
|
||||
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -180,14 +180,14 @@ jobs:
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
${{ env.logdir }}
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
build_tag: ${{ steps.tag_build.outputs.build_tag }}
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
environment: weekly-build
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -104,9 +104,9 @@ jobs:
|
||||
fetch-tags: true
|
||||
submodules: 'recursive'
|
||||
|
||||
- uses: prefix-dev/setup-pixi@194d461b21b6c5717c722ffc597fa91ed2ff29fa # v0.9.1
|
||||
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
|
||||
with:
|
||||
pixi-version: v0.48.1
|
||||
pixi-version: v0.59.0
|
||||
cache: false
|
||||
|
||||
- name: Install the Apple certificate and provisioning profile
|
||||
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# file types to ignore
|
||||
.*
|
||||
!/.packit.yaml
|
||||
!/.clang-format
|
||||
!/.clang-tidy
|
||||
!/.git-blame-ignore-revs
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
specfile_path: package/fedora/freecad.spec
|
||||
files_to_sync:
|
||||
- .packit.yaml
|
||||
actions:
|
||||
post-upstream-clone:
|
||||
- bash -c 'BUILD_TAG=dev /usr/bin/python3 package/rattler-build/scripts/make_version_file.py freecad_version.txt'
|
||||
- rm -f freecad-sources.tar.gz
|
||||
changelog-entry:
|
||||
- bash -c 'git log --no-merges --pretty="format:- %s (%an)" $(git describe --tags --abbrev=0 )..HEAD -- |sed 's/%/%%/g''
|
||||
create-archive:
|
||||
- git submodule update --init
|
||||
- bash -c 'git ls-files --recurse-submodules | tar -caf freecad-sources.tar.gz -T-'
|
||||
- echo -n 'freecad-sources.tar.gz'
|
||||
downstream_package_name: freecad
|
||||
additional_packages:
|
||||
- python3
|
||||
|
||||
jobs:
|
||||
- job: copr_build
|
||||
identifier: pull_request
|
||||
trigger: pull_request
|
||||
notifications:
|
||||
pull_request:
|
||||
successful_build: True
|
||||
branch: main
|
||||
additional_repos:
|
||||
- copr://bpostle/IfcOpenShell
|
||||
manual_trigger: true
|
||||
targets:
|
||||
fedora-stable:
|
||||
without_opts:
|
||||
- debug_info
|
||||
fedora-development:
|
||||
without_opts:
|
||||
- debug_info
|
||||
|
||||
- job: tests
|
||||
identifier: pull_request
|
||||
trigger: pull_request
|
||||
branch: main
|
||||
manual_trigger: true
|
||||
targets:
|
||||
fedora-latest-stable:
|
||||
without_opts:
|
||||
- debug_info
|
||||
fmf_path: package/fedora/tests
|
||||
|
||||
- job: copr_build
|
||||
identifier: main
|
||||
trigger: commit
|
||||
manual_trigger: true
|
||||
branch: main
|
||||
additional_repos:
|
||||
- copr://bpostle/IfcOpenShell
|
||||
owner: freecad
|
||||
project: nightly
|
||||
|
||||
- job: copr_build
|
||||
identifier: release
|
||||
trigger: release
|
||||
owner: freecad
|
||||
project: freecad
|
||||
additional_repos:
|
||||
- copr://bpostle/IfcOpenShell
|
||||
targets:
|
||||
fedora-all:
|
||||
without_opts:
|
||||
- tests
|
||||
+15
-7
@@ -6,20 +6,24 @@ files: |
|
||||
(?x)^(
|
||||
.github|
|
||||
src/Base|
|
||||
src/Gui|
|
||||
src/Main|
|
||||
src/Tools|
|
||||
tests/src|
|
||||
src/Mod/Assembly|
|
||||
src/Mod/BIM|
|
||||
src/Mod/CAM|
|
||||
src/Mod/Cloud|
|
||||
src/Mod/Draft|
|
||||
src/Mod/Fem|
|
||||
src/Mod/Help|
|
||||
src/Mod/Import|
|
||||
src/Mod/Inspection|
|
||||
src/Mod/JtReader|
|
||||
src/Mod/Measure|
|
||||
src/Mod/Mesh|
|
||||
src/Mod/MeshPart|
|
||||
src/Mod/Mesh|
|
||||
src/Mod/PartDesign|
|
||||
src/Mod/Part|
|
||||
src/Mod/Plot|
|
||||
src/Mod/Points|
|
||||
src/Mod/ReverseEngineering|
|
||||
@@ -31,7 +35,8 @@ files: |
|
||||
src/Mod/Surface|
|
||||
src/Mod/Test|
|
||||
src/Mod/Tux|
|
||||
src/Mod/Web
|
||||
src/Mod/Web|
|
||||
tests/src
|
||||
)
|
||||
exclude: |
|
||||
(?x)^(
|
||||
@@ -44,12 +49,15 @@ exclude: |
|
||||
src/Gui/3Dconnexion/navlib|
|
||||
src/Gui/QSint|
|
||||
src/Gui/Quarter|
|
||||
src/Mod/Fem/femexamples|
|
||||
src/Mod/Import/App/SCL|
|
||||
src/Mod/Import/App/SCL_output|
|
||||
src/Mod/Mesh/App/TestData|
|
||||
src/Mod/Mesh/App/WildMagic4|
|
||||
src/Mod/Robot/App/kdl_cp|
|
||||
src/Mod/Robot/Lib
|
||||
src/Mod/Robot/Lib|
|
||||
.*\.ts$|
|
||||
.*\.brep$
|
||||
)
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
@@ -60,12 +68,12 @@ repos:
|
||||
- id: check-yaml
|
||||
- id: check-added-large-files
|
||||
- id: mixed-line-ending
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # frozen: 25.1.0
|
||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||
rev: 2892f1f81088477370d4fbc56545c05d33d2493f # frozen: 25.11.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ['--line-length', '100']
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: 86fdcc9bd34d6afbbd29358b97436c8ffe3aa3b2 # frozen: v21.1.0
|
||||
rev: 317810f3c6a0ad3572367dc86cb6e41863e16e08 # frozen: v21.1.5
|
||||
hooks:
|
||||
- id: clang-format
|
||||
|
||||
+139
-1
@@ -307,6 +307,144 @@
|
||||
"value": "OFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rpm",
|
||||
"description": "Settings like rpm build",
|
||||
"displayName": "rpm",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build/rpm",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_DATAROOTDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/share"
|
||||
},
|
||||
"CMAKE_C_FLAGS_RELEASE": {
|
||||
"type": "STRING",
|
||||
"value": "-DNDEBUG"
|
||||
},
|
||||
"CMAKE_CXX_FLAGS_RELEASE": {
|
||||
"type": "STRING",
|
||||
"value": "-DNDEBUG"
|
||||
},
|
||||
"CMAKE_Fortran_FLAGS_RELEASE": {
|
||||
"type": "STRING",
|
||||
"value": "-DNDEBUG"
|
||||
},
|
||||
"CMAKE_VERBOSE_MAKEFILE": {
|
||||
"type": "BOOL",
|
||||
"value": "ON"
|
||||
},
|
||||
"CMAKE_INSTALL_DO_STRIP": {
|
||||
"type": "BOOL",
|
||||
"value": "OFF"
|
||||
},
|
||||
"CMAKE_INSTALL_PREFIX": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/lib64/freecad"
|
||||
},
|
||||
"CMAKE_INSTALL_FULL_SBINDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/bin"
|
||||
},
|
||||
"CMAKE_INSTALL_SBINDIR": {
|
||||
"type": "PATH",
|
||||
"value": "bin"
|
||||
},
|
||||
"INCLUDE_INSTALL_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/include"
|
||||
},
|
||||
"LIB_INSTALL_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/lib64"
|
||||
},
|
||||
"SYSCONF_INSTALL_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/etc"
|
||||
},
|
||||
"SHARE_INSTALL_PREFIX": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/share"
|
||||
},
|
||||
"LIB_SUFFIX": {
|
||||
"type": "STRING",
|
||||
"value": "64"
|
||||
},
|
||||
"BUILD_SHARED_LIBS": {
|
||||
"type": "BOOL",
|
||||
"value": "ON"
|
||||
},
|
||||
"CMAKE_INSTALL_DOCDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/share/doc/freecad"
|
||||
},
|
||||
"CMAKE_INSTALL_INCLUDEDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/include"
|
||||
},
|
||||
"RESOURCEDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/share/freecad"
|
||||
},
|
||||
"FREECAD_USE_EXTERNAL_PIVY": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"FREECAD_USE_EXTERNAL_FMT": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"FREECAD_USE_PCL": {
|
||||
"type": "BOOL",
|
||||
"value": "OFF"
|
||||
},
|
||||
"FREECAD_QT_VERSION": {
|
||||
"type": "STRING",
|
||||
"value": "6"
|
||||
},
|
||||
"OpenGL_GL_PREFERENCE": {
|
||||
"type": "STRING",
|
||||
"value": "GLVND"
|
||||
},
|
||||
"USE_OCC": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"PYCXX_INCLUDE_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/include"
|
||||
},
|
||||
"PYCXX_SOURCE_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/src/CXX"
|
||||
},
|
||||
"ENABLE_DEVELOPER_TESTS": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"FREECAD_USE_EXTERNAL_GTEST": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"ONDSELSOLVER_BUILD_EXE": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"BUILD_GUI": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"CC": "gcc",
|
||||
"CXX": "g++",
|
||||
"LT_SYS_LIBRARY_PATH": "/usr/lib64:",
|
||||
"CCACHE_PROGRAM": "/usr/bin/ccache",
|
||||
"CFLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
|
||||
"CXXFLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
|
||||
"LDFLAGS": "-Wl,--as-needed -Wl,--no-undefined"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ The FreeCAD Contribution Process is expressed here with the following specific g
|
||||
9. A PR MUST compile cleanly and pass project self-tests on all target platforms.
|
||||
10. Changes that break python API used by extensions SHALL be avoided. If it is not possible to avoid breaking changes, the amount of them MUST be minimized and PR MUST clearly describe all breaking changes with clear description on how to replace no longer working solution with newer one. Contributor SHOULD search for addons that will be broken and list them in the PR.
|
||||
11. Each commit message in a PR MUST succinctly explain what the commit achieves. The commit message SHALL follow the suggestions in the `git commit --help` documentation, section DISCUSSION.
|
||||
12. The PR message MUST consist of a single short line, the PR Title, summarizing the problem being solved, followed by a blank line and then the proposed solution in the Body. If a PR consists of more than one commit, the PR Title MUST succinctly explain what the PR achieves. The Body MAY be as detailed as needed. If a PR changes the user interface (UI), the body of the text MUST include a presentation of these UI changes, preferably with screenshots of the previous and revised state.
|
||||
12. The PR Title MUST succinctly explain what the PR achieves. The Body MAY be as detailed as needed. If a PR changes the user interface (UI), the body of the text MUST include a presentation of these UI changes, preferably with screenshots of the previous and revised state.
|
||||
13. If a PR contains the work of another author (for example, if it is cherry-picked from a fork by someone other than the PR-submitter):
|
||||
1. the PR description MUST contain proper attribution as the first line, for example: "This is work of XYZ cherry-picked from <link>";
|
||||
2. all commits MUST have proper authorship, i.e. be authored by the original author and committed by the author of the PR;
|
||||
|
||||
@@ -1,113 +1,125 @@
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street - Fifth Floor
|
||||
Boston, MA 02110-1301, USA.
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
@@ -134,7 +146,7 @@ such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
@@ -146,7 +158,7 @@ Library.
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
@@ -204,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
@@ -255,8 +267,8 @@ Library will still fall under Section 6.)
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
@@ -283,23 +295,31 @@ of these things:
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
@@ -309,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
@@ -348,9 +368,9 @@ Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
@@ -391,7 +411,7 @@ excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
@@ -402,7 +422,7 @@ conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
@@ -412,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
@@ -435,8 +455,9 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
How to Apply These Terms to Your New Libraries
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
@@ -455,7 +476,7 @@ convey the exclusion of warranty; and each file should have at least the
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -464,7 +485,8 @@ convey the exclusion of warranty; and each file should have at least the
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
@@ -473,7 +495,8 @@ school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
library `Frob' (a library for tweaking knobs) written by James Random
|
||||
Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
[Blog](https://blog.freecad.org)
|
||||
|
||||
|
||||
[](https://github.com/freecad/freecad/releases/latest) [](https://crowdin.com/project/freecad) [](https://liberapay.com/FreeCAD)
|
||||
[](https://github.com/freecad/freecad/releases/latest) [](https://crowdin.com/project/freecad)
|
||||
|
||||
<img src="/.github/images/partdesign.png" width="800"/>
|
||||
|
||||
|
||||
+20
-9
@@ -23,16 +23,27 @@ if(NOT Eigen3_FIND_VERSION)
|
||||
endif(NOT Eigen3_FIND_VERSION)
|
||||
|
||||
macro(_eigen3_check_version)
|
||||
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
|
||||
# file Version exists from Eigen3 5.0.0
|
||||
if (EXISTS "${EIGEN3_INCLUDE_DIR}/Eigen/Version")
|
||||
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/Version" _eigen3_version_header)
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_PATCH_VERSION[ \t]+([0-9]+)" _eigen3_patch_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_PATCH_VERSION "${CMAKE_MATCH_1}")
|
||||
set(EIGEN3_VERSION ${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}.${EIGEN3_PATCH_VERSION})
|
||||
else()
|
||||
file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
|
||||
set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
|
||||
set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
|
||||
if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
|
||||
set(EIGEN3_VERSION_OK FALSE)
|
||||
message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
|
||||
|
||||
@@ -22,7 +22,7 @@ macro(CheckInterModuleDependencies)
|
||||
REQUIRES_MODS(BUILD_DRAFT BUILD_SKETCHER BUILD_TECHDRAW)
|
||||
REQUIRES_MODS(BUILD_DRAWING BUILD_PART BUILD_SPREADSHEET)
|
||||
REQUIRES_MODS(BUILD_FEM BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_IMPORT BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_IMPORT BUILD_PART BUILD_PART_DESIGN)
|
||||
REQUIRES_MODS(BUILD_INSPECTION BUILD_MESH BUILD_POINTS BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_JTREADER BUILD_MESH)
|
||||
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH)
|
||||
|
||||
@@ -24,11 +24,7 @@ macro(InitializeFreeCADBuildOptions)
|
||||
option(INSTALL_TO_SITEPACKAGES "If ON the freecad root namespace (python) is installed into python's site-packages" ON)
|
||||
option(INSTALL_PREFER_SYMLINKS "If ON then fc_copy_sources macro will create symlinks instead of copying files" OFF)
|
||||
option(OCCT_CMAKE_FALLBACK "disable usage of occt-config files" OFF)
|
||||
if (WIN32 OR APPLE)
|
||||
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." OFF)
|
||||
else()
|
||||
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON)
|
||||
endif()
|
||||
option(FREECAD_USE_QT_DIALOGS "Use Qt's dialogs instead of the native one." OFF)
|
||||
|
||||
# == Win32 is default behaviour use the LibPack copied in Source tree ==========
|
||||
if(MSVC)
|
||||
|
||||
@@ -3,7 +3,7 @@ macro(SetupBoost)
|
||||
|
||||
set(_boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS})
|
||||
|
||||
set (BOOST_COMPONENTS program_options regex system thread date_time)
|
||||
set (BOOST_COMPONENTS program_options regex thread date_time)
|
||||
find_package(Boost ${BOOST_MIN_VERSION}
|
||||
COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
|
||||
|
||||
|
||||
@@ -18,8 +18,12 @@ MACRO (fc_copy_sources target_name outpath)
|
||||
foreach(it ${ARGN})
|
||||
get_filename_component(infile ${it} ABSOLUTE)
|
||||
get_filename_component(outfile "${outpath}/${it}" ABSOLUTE)
|
||||
# Ensure parent directory exists when copying or creating symlinks
|
||||
get_filename_component(outfile_dir "${outfile}" PATH)
|
||||
add_file_dependencies("${infile}" "${outfile}")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
# Make sure destination directory exists before copy/symlink
|
||||
COMMAND "${CMAKE_COMMAND}" -E make_directory "${outfile_dir}"
|
||||
COMMAND "${CMAKE_COMMAND}" -E ${copy_command} "${infile}" "${outfile}"
|
||||
OUTPUT "${outfile}"
|
||||
COMMENT "Copying ${infile} to ${outfile}${fc_details}"
|
||||
@@ -211,47 +215,6 @@ macro(generate_from_any INPUT_FILE OUTPUT_FILE VARIABLE)
|
||||
endmacro(generate_from_any)
|
||||
|
||||
|
||||
|
||||
MACRO(ADD_MSVC_PRECOMPILED_HEADER TargetName PrecompiledHeader PrecompiledSource SourcesVar)
|
||||
IF(MSVC)
|
||||
GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE)
|
||||
IF(MSVC_IDE)
|
||||
SET(PrecompiledBinary "$(IntDir)\\$(TargetName).pch")
|
||||
ELSE(MSVC_IDE)
|
||||
SET(PrecompiledBinary ${CMAKE_CURRENT_BINARY_DIR}/${TargetName}.pch)
|
||||
ENDIF(MSVC_IDE)
|
||||
SET(Sources ${${SourcesVar}})
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource}
|
||||
PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\""
|
||||
OBJECT_OUTPUTS "${PrecompiledBinary}")
|
||||
SET_SOURCE_FILES_PROPERTIES(${Sources}
|
||||
PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledHeader}\" /FI\"${PrecompiledBinary}\" /Fp\"${PrecompiledBinary}\""
|
||||
OBJECT_DEPENDS "${PrecompiledBinary}")
|
||||
# Add precompiled header to SourcesVar
|
||||
LIST(APPEND ${SourcesVar} ${PrecompiledSource})
|
||||
ENDIF(MSVC)
|
||||
ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER)
|
||||
|
||||
MACRO(GET_MSVC_PRECOMPILED_SOURCE PrecompiledSource SourcesVar)
|
||||
IF(MSVC)
|
||||
FOREACH (it ${ARGN})
|
||||
GET_FILENAME_COMPONENT(file_ext ${it} EXT)
|
||||
GET_FILENAME_COMPONENT(file_name ${it} NAME)
|
||||
STRING(COMPARE EQUAL ${it} ${PrecompiledSource} pch)
|
||||
IF (NOT pch)
|
||||
# get c++ source files
|
||||
STRING(REGEX MATCH "^(.cpp|.cc|.cxx)$" cpp_file ${file_ext})
|
||||
# ignore any generated source files from Qt
|
||||
STRING(REGEX MATCH "^(moc_|qrc_|ui_)" gen_file ${file_name})
|
||||
IF(cpp_file AND NOT gen_file)
|
||||
LIST(APPEND ${SourcesVar} ${it})
|
||||
ENDIF(cpp_file AND NOT gen_file)
|
||||
ENDIF(NOT pch)
|
||||
ENDFOREACH (it)
|
||||
ENDIF(MSVC)
|
||||
ENDMACRO(GET_MSVC_PRECOMPILED_SOURCE)
|
||||
|
||||
# Macro to replace all the binary output locations. Takes 2 optional parameters.
|
||||
# ${ARGVN} is zero based so the 3rd element is ${ARGV2}. When the 3rd element is missing,
|
||||
# Runtime and Lib directories default to /bin and /lib. When present, the 3rd element
|
||||
@@ -364,3 +327,4 @@ function(target_compile_warn_error ProjectName)
|
||||
target_compile_options(${ProjectName} PRIVATE -Werror)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
Binary file not shown.
@@ -8,6 +8,9 @@ SET(Examples_Files
|
||||
FEMExample.FCStd
|
||||
AssemblyExample.FCStd
|
||||
ArchDetail.FCStd
|
||||
FCPAT.pat
|
||||
osifont.license
|
||||
osifont-lgpl3fe.ttf
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(Example_data ALL
|
||||
@@ -132,4 +135,3 @@ INSTALL(
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_DATADIR}/examples
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
; standard PAT patterns
|
||||
|
||||
*Diamond, 45 diagonals L & R, Solid, 1.0 mm separation
|
||||
45,0,0,0,1.0
|
||||
-45,0,0,0,1.0
|
||||
*Diamond2, 45 diagonals L & R, Solid, 2.0 mm separation
|
||||
45,0,0,0,2.0
|
||||
-45,0,0,0,2.0
|
||||
*Diamond4, 45 diagonals L & R, Solid, 4.0 mm separation
|
||||
45,0,0,0,4.0
|
||||
-45,0,0,0,4.0
|
||||
*Diagonal4, 45 diagonal R, Solid, 4.0 mm separation
|
||||
45,0,0,0,4.0
|
||||
*Diagonal5, 45 diagonal L, Solid, 4.0 mm separation
|
||||
-45,0,0,0,4.0
|
||||
*Square, square grid, Solid, 5.0 mm separation
|
||||
90,1,1,0,5.0
|
||||
0,0,0,1,5.0
|
||||
*Horizontal5, horizontal lines, Solid 5.0 separation
|
||||
0,0,0,0,5.0
|
||||
*Vertical5, vertical lines, Solid, 5.0 separation
|
||||
90,0,0,0,5.0
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
osifont license:
|
||||
|
||||
osifont-lgpl3fe.ttf is used under one or more of the following licenses:
|
||||
- GNU GPL licence version 3 with GPL font exception,
|
||||
- GNU GPL licence version 2 with GPL font exception,
|
||||
- GNU LGPL licence version 3 with GPL font exception.
|
||||
|
||||
|
||||
https://github.com/hikikomori82/osifont/
|
||||
+239
-281
@@ -1,109 +1,67 @@
|
||||
# This package depends on automagic byte compilation
|
||||
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3
|
||||
%global py_bytecompile 1
|
||||
# Some configuration options for other environments
|
||||
# rpmbuild --without=bundled_zipios: don't use bundled version of zipios++
|
||||
%bcond_without bundled_zipios
|
||||
# rpmbuild --with=bundled_pycxx: use bundled version of pycxx
|
||||
%bcond_with bundled_pycxx
|
||||
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
|
||||
%bcond_without bundled_smesh
|
||||
# rpmbuild --without=bundled_gtest: don't use bundled version of gtest and gmock
|
||||
%bcond_with bundled_gtest
|
||||
|
||||
# rpmbuild --without=tests exclude tests in %%check
|
||||
%bcond_without tests
|
||||
# rpmbuild --without=debug_info don't generate package with debug info
|
||||
%bcond_without debug_info
|
||||
|
||||
|
||||
Name: freecad
|
||||
Epoch: 1
|
||||
Version: 1.1.0~dev
|
||||
Release: 1%{?dist}
|
||||
|
||||
Summary: A general purpose 3D CAD modeler
|
||||
Group: Applications/Engineering
|
||||
License: LGPL-2.0-or-later
|
||||
URL: https://www.freecad.org/
|
||||
|
||||
Source0: freecad-sources.tar.gz
|
||||
|
||||
# Setup python target for shiboken so the right cmake file is imported.
|
||||
%global py_suffix %(%{__python3} -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))")
|
||||
|
||||
# Maintainers: keep this list of plugins up to date
|
||||
# List plugins in %%{_libdir}/%{name}/lib, less '.so' and 'Gui.so', here
|
||||
%global plugins AssemblyApp AssemblyGui CAMSimulator DraftUtils Fem FreeCAD Import Inspection MatGui Materials Measure Mesh MeshPart Part PartDesignGui Path PathApp PathSimulator Points QtUnitGui ReverseEngineering Robot Sketcher Spreadsheet Start Surface TechDraw Web _PartDesign area flatmesh libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libOndselSolver libSMDS libSMESH libSMESHDS libStdMeshers libarea-native
|
||||
# List plugins in %%{_libdir}/%%{name}/lib, less '.so' and 'Gui.so', here
|
||||
%global plugins AssemblyApp AssemblyGui CAMSimulator DraftUtils Fem FreeCAD Import Inspection MatGui Materials Measure Mesh MeshPart Part PartDesignGui Path PathApp PathSimulator Points QtUnitGui ReverseEngineering Robot Sketcher Spreadsheet Start Surface TechDraw Web _PartDesign area flatmesh libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libSMDS libSMESH libSMESHDS libStdMeshers libarea-native
|
||||
|
||||
# Some configuration options for other environments
|
||||
# rpmbuild --with=bundled_zipios: use bundled version of zipios++
|
||||
%global bundled_zipios %{?_with_bundled_zipios: 1} %{?!_with_bundled_zipios: 1}
|
||||
# rpmbuild --with=bundled_pycxx: use bundled version of pycxx
|
||||
%global bundled_pycxx %{?_with_bundled_pycxx: 1} %{?!_with_bundled_pycxx: 0}
|
||||
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
|
||||
%global bundled_smesh %{?_without_bundled_smesh: 0} %{?!_without_bundled_smesh: 1}
|
||||
|
||||
# Prevent RPM from doing its magical 'build' directory for now
|
||||
%global __cmake_in_source_build 0
|
||||
%global exported_libs libOndselSolver
|
||||
|
||||
|
||||
# See FreeCAD-main/src/3rdParty/salomesmesh/CMakeLists.txt to find this out.
|
||||
%global bundled_smesh_version 7.7.1.0
|
||||
|
||||
# Some plugins go in the Mod folder instead of lib. Deal with those here:
|
||||
%global mod_plugins Mod/PartDesign
|
||||
%define name freecad
|
||||
%define github_name FreeCAD
|
||||
%define branch main
|
||||
|
||||
Name: %{name}
|
||||
Epoch: 1
|
||||
Version: 1.1.0
|
||||
Release: pre_{{{git_commit_no}}}%{?dist}
|
||||
Summary: A general purpose 3D CAD modeler
|
||||
Group: Applications/Engineering
|
||||
|
||||
License: LGPLv2+
|
||||
URL: https://www.freecad.org/
|
||||
Source0: {{{ git_repo_pack }}}
|
||||
#add all submodule as source
|
||||
Source1: {{{ git_pack path=$GIT_ROOT/src/3rdParty/OndselSolver/ dir_name="OndselSolver" }}}
|
||||
Source2: {{{ git_pack path=$GIT_ROOT/src/3rdParty/GSL/ dir_name="GSL" }}}
|
||||
Source3: {{{ git_pack path=$GIT_ROOT/src/Mod/AddonManager/ dir_name="AddonManager" }}}
|
||||
|
||||
# See /src/3rdParty/PyCXX/CXX/Version.h to find this out.
|
||||
%global bundled_pycxx_version 7.1.9
|
||||
# See /src/3rdParty/OndselSolver/CMakeLists.txt to find this out.
|
||||
%global bundled_ondsel_solver_version 1.0.1
|
||||
|
||||
# Utilities
|
||||
BuildRequires: cmake gcc-c++ gettext
|
||||
BuildRequires: doxygen swig graphviz
|
||||
BuildRequires: gcc-gfortran
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: git
|
||||
|
||||
BuildRequires: tbb-devel
|
||||
BuildRequires: cmake gcc-c++ gettext doxygen swig graphviz gcc-gfortran desktop-file-utils tbb-devel ninja-build strace
|
||||
%if %{with tests}
|
||||
BuildRequires: xorg-x11-server-Xvfb python3-typing-extensions
|
||||
%if %{without bundled_gtest}
|
||||
BuildRequires: gtest-devel gmock-devel
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Development Libraries
|
||||
BuildRequires: freeimage-devel
|
||||
BuildRequires: libXmu-devel
|
||||
BuildRequires: mesa-libEGL-devel
|
||||
BuildRequires: mesa-libGLU-devel
|
||||
BuildRequires: opencascade-devel
|
||||
BuildRequires: Coin4-devel
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-matplotlib
|
||||
BuildRequires: python3-pivy
|
||||
BuildRequires: boost-devel
|
||||
BuildRequires: eigen3-devel
|
||||
BuildRequires: qt6-qtsvg-devel
|
||||
BuildRequires: qt6-qttools-static
|
||||
|
||||
BuildRequires: fmt-devel
|
||||
|
||||
BuildRequires: xerces-c
|
||||
BuildRequires: xerces-c-devel
|
||||
BuildRequires: libspnav-devel
|
||||
|
||||
BuildRequires: python3-shiboken6-devel
|
||||
BuildRequires: python3-pyside6-devel
|
||||
BuildRequires: pyside6-tools
|
||||
%if ! %{bundled_smesh}
|
||||
BuildRequires:boost-devel Coin4-devel eigen3-devel freeimage-devel fmt-devel libglvnd-devel libicu-devel libspnav-devel libXmu-devel med-devel mesa-libEGL-devel mesa-libGLU-devel netgen-mesher-devel netgen-mesher-devel-private opencascade-devel openmpi-devel python3 python3-devel python3-matplotlib python3-pivy python3-pybind11 python3-pyside6-devel python3-shiboken6-devel pyside6-tools qt6-qttools-static qt6-qtsvg-devel vtk-devel xerces-c-devel yaml-cpp-devel
|
||||
#pcl-devel
|
||||
%if %{without bundled_smesh}
|
||||
BuildRequires: smesh-devel
|
||||
%endif
|
||||
BuildRequires: netgen-mesher-devel
|
||||
BuildRequires: netgen-mesher-devel-private
|
||||
%if ! %{bundled_zipios}
|
||||
%if %{without bundled_zipios}
|
||||
BuildRequires: zipios++-devel
|
||||
%endif
|
||||
|
||||
%if ! %{bundled_pycxx}
|
||||
%if %{without bundled_pycxx}
|
||||
BuildRequires: python3-pycxx-devel
|
||||
%endif
|
||||
BuildRequires: python3-pybind11
|
||||
BuildRequires: libicu-devel
|
||||
BuildRequires: vtk-devel
|
||||
BuildRequires: openmpi-devel
|
||||
BuildRequires: med-devel
|
||||
BuildRequires: libkdtree++-devel
|
||||
|
||||
BuildRequires: pcl-devel
|
||||
BuildRequires: python3
|
||||
BuildRequires: libglvnd-devel
|
||||
BuildRequires: yaml-cpp-devel
|
||||
#BuildRequires: zlib-devel
|
||||
|
||||
# For appdata
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: libappstream-glib
|
||||
@@ -115,38 +73,31 @@ Requires: %{name}-data = %{epoch}:%{version}-%{release}
|
||||
# Obsolete old doc package since it's required for functionality.
|
||||
Obsoletes: %{name}-doc < 0.22-1
|
||||
|
||||
Requires: hicolor-icon-theme
|
||||
Requires: hicolor-icon-theme fmt python3-matplotlib python3-pivy python3-collada python3-pyside6 qt6-assistant python3-typing-extensions python3-defusedxml
|
||||
|
||||
Requires: fmt
|
||||
|
||||
Requires: python3-pivy
|
||||
Requires: python3-matplotlib
|
||||
Requires: python3-collada
|
||||
Requires: python3-pyside6
|
||||
Requires: qt6-assistant
|
||||
|
||||
|
||||
%if %{bundled_smesh}
|
||||
%if %{with bundled_smesh}
|
||||
Provides: bundled(smesh) = %{bundled_smesh_version}
|
||||
%endif
|
||||
%if %{bundled_pycxx}
|
||||
Provides: bundled(python-pycxx)
|
||||
%if %{with bundled_pycxx}
|
||||
Provides: bundled(python-pycxx) = %{bundled_pycxx_version}
|
||||
%endif
|
||||
Recommends: python3-pysolar
|
||||
Provides: bundled(libondselsolver) = %{bundled_ondsel_solver_version}
|
||||
|
||||
Recommends: python3-pysolar IfcOpenShell-python3
|
||||
|
||||
|
||||
|
||||
# plugins and private shared libs in %%{_libdir}/freecad/lib are private;
|
||||
# prevent private capabilities being advertised in Provides/Requires
|
||||
%define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i\\\|$iGui"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
|
||||
%{?filter_setup:
|
||||
%filter_provides_in %{_libdir}/%{name}/lib
|
||||
%filter_from_requires %{plugin_regexp}
|
||||
%filter_from_provides %{plugin_regexp}
|
||||
%filter_provides_in %{_libdir}/%{name}/Mod
|
||||
%filter_requires_in %{_libdir}/%{name}/Mod
|
||||
%filter_setup
|
||||
}
|
||||
%global plugin_exclude %( for i in %{plugins}; do echo -n "\|$i\(Gui\)\?"; done )
|
||||
# prevent declaring Requires for internal FreeCAD libraries
|
||||
%global lib_exclude %( for i in %{exported_libs}; do echo -n "\|$i"; done )
|
||||
%global __requires_exclude_from ^%{_libdir}/%{name}/(lib|Mod)/.*
|
||||
%global __provides_exclude_from ^%{_libdir}/%{name}/Mod/.*
|
||||
%global __provides_exclude ^(libFreeCAD.*%{plugin_exclude})\.so.*
|
||||
%global __requires_exclude ^(libFreeCAD.*%{plugin_exclude}%{lib_exclude})\.so.*
|
||||
|
||||
|
||||
|
||||
%description
|
||||
FreeCAD is a general purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler, aimed
|
||||
@@ -165,204 +116,211 @@ Requires: %{name} = %{epoch}:%{version}-%{release}
|
||||
%description data
|
||||
Data files for FreeCAD
|
||||
|
||||
%package libondselsolver-devel
|
||||
Summary: Development file for OndselSolver
|
||||
BuildArch: noarch
|
||||
Requires: %{name} = %{epoch}:%{version}-%{release}
|
||||
|
||||
%description libondselsolver-devel
|
||||
Development file for OndselSolver
|
||||
|
||||
|
||||
#path that contain main FreeCAD sources for cmake
|
||||
%global tests_resultdir %{_datadir}/%{name}/tests_result/%{_arch}
|
||||
|
||||
%if %{without debug_info}
|
||||
%global debug_package %{nil}
|
||||
%global _enable_debug_packages 0
|
||||
%endif
|
||||
|
||||
%prep
|
||||
rm -rf %{github_name}
|
||||
# extract submodule archive and move in correct path
|
||||
%setup -T -a 1 -c -q -D -n %{github_name}/src/3rdParty/ #OndselSolver
|
||||
%setup -T -a 2 -c -q -D -n %{github_name}/src/3rdParty/ #GSL
|
||||
%setup -T -a 3 -c -q -D -n %{github_name}/src/Mod/ #AddonManager
|
||||
|
||||
%setup -T -b 0 -q -D -n %{github_name}
|
||||
|
||||
|
||||
# Remove bundled pycxx if we're not using it
|
||||
%if ! %{bundled_pycxx}
|
||||
rm -rf src/CXX
|
||||
%endif
|
||||
|
||||
%if ! %{bundled_zipios}
|
||||
rm -rf src/zipios++
|
||||
#sed -i "s/zipios-config.h/zipios-config.hpp/g" \
|
||||
# src/Base/Reader.cpp src/Base/Writer.h
|
||||
%endif
|
||||
|
||||
# Removed bundled libraries
|
||||
%setup -T -a 0 -q -c -n FreeCAD-1.0.2
|
||||
|
||||
%build
|
||||
rm -rf build && mkdir build && cd build
|
||||
# Deal with cmake projects that tend to link excessively.
|
||||
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
|
||||
|
||||
# Deal with cmake projects that tend to link excessively.
|
||||
CXXFLAGS='-Wno-error=cast-function-type'; export CXXFLAGS
|
||||
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
|
||||
# -DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
|
||||
# -DCMAKE_INSTALL_DATAROOTDIR=%{_datadir} \
|
||||
|
||||
%define MEDFILE_INCLUDE_DIRS %{_includedir}/med/
|
||||
%cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
|
||||
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
|
||||
-DRESOURCEDIR=%{_datadir}/%{name} \
|
||||
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
|
||||
-DFREECAD_USE_EXTERNAL_FMT=TRUE \
|
||||
-DFREECAD_USE_PCL:BOOL=OFF \
|
||||
-DFREECAD_QT_VERSION:STRING=6 \
|
||||
-DOpenGL_GL_PREFERENCE=GLVND \
|
||||
-DUSE_OCC=TRUE \
|
||||
%if %{without bundled_pycxx}
|
||||
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
|
||||
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
|
||||
%endif
|
||||
%if %{without bundled_smesh}
|
||||
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
|
||||
%endif
|
||||
%if %{without bundled_zipios}
|
||||
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
|
||||
%endif
|
||||
%if %{with tests}
|
||||
-DENABLE_DEVELOPER_TESTS=TRUE \
|
||||
%if %{without bundled_gtest}
|
||||
-DFREECAD_USE_EXTERNAL_GTEST=TRUE \
|
||||
%else
|
||||
-DINSTALL_GTEST=OFF \
|
||||
-DINSTALL_GMOCK=OFF \
|
||||
%endif
|
||||
%else
|
||||
-DENABLE_DEVELOPER_TESTS=FALSE \
|
||||
%endif
|
||||
-DONDSELSOLVER_BUILD_EXE=TRUE \
|
||||
-DBUILD_GUI=TRUE \
|
||||
-G Ninja
|
||||
|
||||
%cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
|
||||
-DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
|
||||
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
|
||||
-DRESOURCEDIR=%{_datadir}/%{name} \
|
||||
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
|
||||
-DFREECAD_USE_EXTERNAL_FMT=TRUE \
|
||||
-DFREECAD_USE_PCL:BOOL=OFF \
|
||||
-DFREECAD_QT_VERSION:STRING=6 \
|
||||
-DSHIBOKEN_INCLUDE_DIR=%{_includedir}/shiboken6 \
|
||||
-DSHIBOKEN_LIBRARY=-lshiboken6.%{py_suffix} \
|
||||
-DPYTHON_SUFFIX=.%{py_suffix} \
|
||||
-DPYSIDE_INCLUDE_DIR=/usr/include/PySide6 \
|
||||
-DPYSIDE_LIBRARY=-lpyside6.%{py_suffix} \
|
||||
-DPython3_EXECUTABLE:FILEPATH=/usr/bin/python3 \
|
||||
-DMEDFILE_INCLUDE_DIRS=%{MEDFILE_INCLUDE_DIRS} \
|
||||
-DOpenGL_GL_PREFERENCE=GLVND \
|
||||
-DCOIN3D_INCLUDE_DIR=%{_includedir}/Coin4 \
|
||||
-DCOIN3D_DOC_PATH=%{_datadir}/Coin4/Coin \
|
||||
-DUSE_OCC=TRUE \
|
||||
%if ! %{bundled_smesh}
|
||||
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
|
||||
-DSMESH_FOUND=TRUE \
|
||||
-DSMESH_INCLUDE_DIR=%{_includedir}/smesh \
|
||||
-DSMESH_DIR=`pwd`/../cMake \
|
||||
%endif
|
||||
%if ! %{bundled_zipios}
|
||||
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
|
||||
%endif
|
||||
%if ! %{bundled_pycxx}
|
||||
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
|
||||
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
|
||||
%endif
|
||||
-DPACKAGE_WCREF="%{release} (Git)" \
|
||||
-DPACKAGE_WCURL="git://github.com/%{github_name}/FreeCAD.git main" \
|
||||
-DENABLE_DEVELOPER_TESTS=FALSE \
|
||||
-DBUILD_GUI=TRUE \
|
||||
../
|
||||
%cmake_build
|
||||
|
||||
make fc_version
|
||||
for I in src/Build/Version.h src/Build/Version.h.out; do
|
||||
sed -i 's,FCRevision \"Unknown\",FCRevision \"%{release} (Git)\",' $I
|
||||
sed -i 's,FCRepositoryURL \"Unknown\",FCRepositoryURL \"git://github.com/FreeCAD/FreeCAD.git main\",' $I
|
||||
done
|
||||
|
||||
%{make_build}
|
||||
|
||||
%install
|
||||
cd build
|
||||
%make_install
|
||||
%cmake_install
|
||||
|
||||
# Symlink binaries to /usr/bin
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
ln -s ../%{_lib}/%{name}/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD
|
||||
ln -s ../%{_lib}/%{name}/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd
|
||||
# Symlink binaries to /usr/bin
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
ln -s ../%{_lib}/%{name}/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD
|
||||
ln -s ../%{_lib}/%{name}/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd
|
||||
|
||||
mkdir %{buildroot}%{_metainfodir}/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/metainfo/* %{buildroot}%{_metainfodir}/
|
||||
# Remove header from external library that's erroneously installed
|
||||
rm -rf %{buildroot}%{_libdir}/%{name}/include/E57Format
|
||||
rm -rf %{buildroot}%{_includedir}/gmock
|
||||
rm -rf %{buildroot}%{_includedir}/gtest
|
||||
|
||||
mkdir %{buildroot}%{_datadir}/applications/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/applications/* %{buildroot}%{_datadir}/applications/
|
||||
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/thumbnailers/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/thumbnailers/* %{buildroot}%{_datadir}/thumbnailers/
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/icons/hicolor/scalable/* %{buildroot}%{_datadir}/icons/hicolor/scalable/
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/pixmaps/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/pixmaps/* %{buildroot}%{_datadir}/pixmaps/
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/mime/packages/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/mime/packages/* %{buildroot}%{_datadir}/mime/packages/
|
||||
|
||||
pushd %{buildroot}%{_libdir}/%{name}/share/
|
||||
rmdir metainfo/
|
||||
rmdir applications/
|
||||
rm -rf mime
|
||||
rm -rf icons
|
||||
popd
|
||||
|
||||
# Remove obsolete Start_Page.html
|
||||
rm -f %{buildroot}%{_docdir}/%{name}/Start_Page.html
|
||||
|
||||
# Remove header from external library that's erroneously installed
|
||||
rm -f %{buildroot}%{_libdir}/%{name}/include/E57Format/E57Export.h
|
||||
|
||||
rm -rf %{buildroot}%{_includedir}/OndselSolver/*
|
||||
rm -f %{buildroot}%{_libdir}/%{name}/share/pkgconfig/OndselSolver.pc
|
||||
|
||||
# Bug maintainers to keep %%{plugins} macro up to date.
|
||||
#
|
||||
# Make sure there are no plugins that need to be added to plugins macro
|
||||
new_plugins=`ls %{buildroot}%{_libdir}/%{name}/%{_lib} | sed -e '%{plugin_regexp}'`
|
||||
if [ -n "$new_plugins" ]; then
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nPlugins not caught by regexp: " $new_plugins \
|
||||
"\n\nPlugins in %{_libdir}/%{name}/lib do not exist in" \
|
||||
"\nspecfile %%{plugins} macro. Please add these to" \
|
||||
"\n%%{plugins} macro at top of specfile and rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# Make sure there are no entries in the plugins macro that don't match plugins
|
||||
for p in %{plugins}; do
|
||||
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$p*.so`" ]; then
|
||||
set +x
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nExtra entry in %%{plugins} macro with no matching plugin:" \
|
||||
"'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
|
||||
"\nspecfile and rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Bytecompile Python modules
|
||||
%py_byte_compile %{__python3} %{buildroot}%{_libdir}/%{name}
|
||||
rm -rf %{buildroot}%{_libdir}/%{name}/%{_lib}/cmake
|
||||
rm -rf %{buildroot}%{_libdir}/%{name}/%{_lib}/pkgconfig
|
||||
|
||||
#Move files using `-DCMAKE_INSTALL_DATAROOTDIR=%%{_datadir}` break ctest
|
||||
mkdir -p %{buildroot}%{_datadir}
|
||||
mv %{buildroot}%{_libdir}/freecad/share/applications %{buildroot}%{_datadir}/
|
||||
mkdir -p %{buildroot}%{_metainfodir}
|
||||
mv %{buildroot}%{_libdir}/freecad/share/metainfo/* %{buildroot}%{_metainfodir}/
|
||||
mkdir -p %{buildroot}%{_datadir}
|
||||
mv %{buildroot}%{_libdir}/freecad/share/icons %{buildroot}%{_datadir}/
|
||||
mv %{buildroot}%{_libdir}/freecad/share/pixmaps %{buildroot}%{_datadir}/
|
||||
mv %{buildroot}%{_libdir}/freecad/share/mime %{buildroot}%{_datadir}/
|
||||
mv %{buildroot}%{_libdir}/freecad/share/thumbnailers %{buildroot}%{_datadir}/
|
||||
mv %{buildroot}%{_libdir}/freecad/share/pkgconfig %{buildroot}%{_datadir}/
|
||||
|
||||
%check
|
||||
desktop-file-validate \
|
||||
%{buildroot}%{_datadir}/applications/org.freecad.FreeCAD.desktop
|
||||
%{?fedora:appstream-util validate-relax --nonet \
|
||||
%{buildroot}%{_metainfodir}/*.metainfo.xml}
|
||||
|
||||
|
||||
%if %{with tests}
|
||||
mkdir -p %{buildroot}%tests_resultdir
|
||||
if %ctest -E '^QuantitySpinBox_Tests_run$' &> %{buildroot}%tests_resultdir/ctest.result ; then
|
||||
echo "ctest OK"
|
||||
else
|
||||
echo "**** Failed ctest ****"
|
||||
touch %{buildroot}%tests_resultdir/ctest.failed
|
||||
fi
|
||||
|
||||
if xvfb-run \%ctest -R '^QuantitySpinBox_Tests_run$' &>> %{buildroot}%tests_resultdir/ctest_gui.result ; then
|
||||
echo "ctest gui OK"
|
||||
else
|
||||
echo "**** Failed ctest gui ****"
|
||||
touch %{buildroot}%tests_resultdir/ctest_gui.failed
|
||||
fi
|
||||
%endif
|
||||
|
||||
desktop-file-validate %{buildroot}%{_datadir}/applications/org.freecad.FreeCAD.desktop
|
||||
%{?fedora:appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml}
|
||||
|
||||
# Bug maintainers to keep %%{plugins} macro up to date.
|
||||
#
|
||||
# Make sure there are no plugins that need to be added to plugins macro
|
||||
%define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
|
||||
%define exported_libs_regexp /^\\\(%(for i in %{exported_libs}; do echo -n "\\\|$i"; done)\\\)\\.so/d
|
||||
|
||||
new_plugins=`ls %{buildroot}%{_libdir}/%{name}/%{_lib} | sed -e '%{plugin_regexp}' -e '%exported_libs_regexp'`
|
||||
if [ -n "$new_plugins" ]; then
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nPlugins not caught by regexps:" \
|
||||
"\n" $new_plugins \
|
||||
"\n\nPlugins in %{_libdir}/%{name}/lib do not exist in" \
|
||||
"\nspecfile %%{plugins} or %%{exported_libs_regexp} macro." \
|
||||
"\nPlease add these to %%{plugins} or %%{exported_libs}" \
|
||||
"\nmacro at top of specfile" \
|
||||
"\nand rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# Make sure there are no entries in the plugins macro that don't match plugins
|
||||
for p in %{plugins}; do
|
||||
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$p*.so`" ]; then
|
||||
set +x
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nExtra entry in %%{plugins} macro with no matching plugin:" \
|
||||
"'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
|
||||
"\nspecfile and rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
# Make sure there are no entries in the exported_libs_regexp macro that don't match plugins
|
||||
for d in %{exported_libs}; do
|
||||
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$d*.so`" ]; then
|
||||
set +x
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nExtra entry in %%{exported_libs} macro with no matching lib:" \
|
||||
"'$d'.\n\nPlease remove from %%{exported_libs} macro at top of" \
|
||||
"\nspecfile and rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%post
|
||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
/usr/bin/update-desktop-database &> /dev/null || :
|
||||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
|
||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
/usr/bin/update-desktop-database &> /dev/null || :
|
||||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
|
||||
|
||||
|
||||
%postun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
|
||||
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
fi
|
||||
/usr/bin/update-desktop-database &> /dev/null || :
|
||||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
|
||||
if [ $1 -eq 0 ] ; then
|
||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
|
||||
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
fi
|
||||
/usr/bin/update-desktop-database &> /dev/null || :
|
||||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
|
||||
|
||||
|
||||
%posttrans
|
||||
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor/scalable/apps &>/dev/null || :
|
||||
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor/scalable/apps &>/dev/null || :
|
||||
|
||||
|
||||
%files
|
||||
%{_bindir}/*
|
||||
%{_metainfodir}/*
|
||||
%dir %{_libdir}/%{name}
|
||||
%{_libdir}/%{name}/bin/
|
||||
%{_libdir}/%{name}/%{_lib}/
|
||||
%{_libdir}/%{name}/Ext/
|
||||
%{_libdir}/%{name}/Mod/
|
||||
%{_libdir}/%{name}/share/
|
||||
%{_datadir}/applications/*
|
||||
%{_datadir}/icons/hicolor/*
|
||||
%{_datadir}/pixmaps/*
|
||||
%{_datadir}/mime/packages/*
|
||||
%{_datadir}/thumbnailers/*
|
||||
#find a way to configure in cmake with %%name to avoid conflict with different package name
|
||||
%{python3_sitelib}/freecad/*
|
||||
%if %{with tests}
|
||||
%tests_resultdir/*
|
||||
%endif
|
||||
|
||||
%{_bindir}/*
|
||||
%{_metainfodir}/*
|
||||
%dir %{_libdir}/%{name}
|
||||
%{_libdir}/%{name}/bin/
|
||||
%{_libdir}/%{name}/%{_lib}/
|
||||
%{_libdir}/%{name}/Ext/
|
||||
%{_libdir}/%{name}/Mod/
|
||||
%{_datadir}/applications/*
|
||||
%{_datadir}/icons/hicolor/scalable/*
|
||||
%{_datadir}/pixmaps/*
|
||||
%{_datadir}/mime/packages/*
|
||||
%{_datadir}/thumbnailers/*
|
||||
%{_libdir}/../lib/python*/site-packages/%{name}/*
|
||||
|
||||
%files data
|
||||
%{_datadir}/%{name}/
|
||||
%{_docdir}/%{name}/LICENSE.html
|
||||
%{_docdir}/%{name}/ThirdPartyLibraries.html
|
||||
%{_datadir}/%{name}/
|
||||
%{_docdir}/%{name}/LICENSE.html
|
||||
%{_docdir}/%{name}/ThirdPartyLibraries.html
|
||||
|
||||
%files libondselsolver-devel
|
||||
%{_datadir}/pkgconfig/OndselSolver.pc
|
||||
%{_includedir}/OndselSolver/*
|
||||
|
||||
%changelog
|
||||
* Mon Mar 10 2025 Leif-Jöran Olsson <info@friprogramvarusyndikatet.se> - 1.1.0-1
|
||||
- Adding support for building with Qt6 and PySide6 for Fedora 40+
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[rpkg]
|
||||
auto_pack = False
|
||||
user_macros = "${git_props:root}/rpkg.macros"
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1 @@
|
||||
!/.fmf/
|
||||
@@ -0,0 +1,12 @@
|
||||
/ctest :
|
||||
test: |
|
||||
cat /usr/share/freecad/tests_result/`uname -m`/ctest.result
|
||||
if [ -f /usr/share/freecad/tests_result/`uname -m`/ctest.failed ]; then
|
||||
exit 1
|
||||
fi
|
||||
/ctest_gui :
|
||||
test: |
|
||||
cat /usr/share/freecad/tests_result/`uname -m`/ctest_gui.result
|
||||
if [ -f /usr/share/freecad/tests_result/`uname -m`/ctest_gui.failed ]; then
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,42 @@
|
||||
/tests:
|
||||
/TestAssemblyWorkbench :
|
||||
test: /usr/bin/FreeCADCmd -t TestAssemblyWorkbench
|
||||
/TestArch :
|
||||
test: /usr/bin/FreeCADCmd -t TestArch
|
||||
/TestCAMApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestCAMApp
|
||||
/TestDraft :
|
||||
test: /usr/bin/FreeCADCmd -t TestDraft
|
||||
/TestFemApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestFemApp
|
||||
/TestMaterialsApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestMaterialsApp
|
||||
/MeshTestsApp :
|
||||
test: /usr/bin/FreeCADCmd -t MeshTestsApp
|
||||
/TestPartApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestPartApp
|
||||
/TestPartDesignApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestPartDesignApp
|
||||
/TestSketcherApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestSketcherApp
|
||||
/TestSpreadsheet :
|
||||
test: /usr/bin/FreeCADCmd -t TestSpreadsheet
|
||||
/TestSurfaceApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestSurfaceApp
|
||||
/TestTechDrawApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestTechDrawApp
|
||||
/BaseTests :
|
||||
test: /usr/bin/FreeCADCmd -t BaseTests
|
||||
/UnitTests :
|
||||
test: /usr/bin/FreeCADCmd -t UnitTests
|
||||
/Document :
|
||||
test: /usr/bin/FreeCADCmd -t Document
|
||||
/Metadata :
|
||||
test: /usr/bin/FreeCADCmd -t Metadata
|
||||
/StringHasher :
|
||||
test: /usr/bin/FreeCADCmd -t StringHasher
|
||||
/UnicodeTests :
|
||||
test: /usr/bin/FreeCADCmd -t UnicodeTests
|
||||
/TestPythonSyntax :
|
||||
test: /usr/bin/FreeCADCmd -t TestPythonSyntax
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/tests:
|
||||
/TestAssemblyWorkbench :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestAssemblyWorkbench
|
||||
/TestArch :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestArch
|
||||
/TestCAMApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestCAMApp
|
||||
/TestDraft :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestDraft
|
||||
/TestFemApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestFemApp
|
||||
/TestMaterialsApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestMaterialsApp
|
||||
/MeshTestsApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t MeshTestsApp
|
||||
/TestPartApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPartApp
|
||||
/TestPartDesignApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignApp
|
||||
/TestSketcherApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestSketcherApp
|
||||
/TestSpreadsheet :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestSpreadsheet
|
||||
/TestSurfaceApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestSurfaceApp
|
||||
/TestTechDrawApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawApp
|
||||
/BaseTests :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t BaseTests
|
||||
/UnitTests :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t UnitTests
|
||||
/Document :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Document
|
||||
/Metadata :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Metadata
|
||||
/StringHasher :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t StringHasher
|
||||
/UnicodeTests :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t UnicodeTests
|
||||
/TestPythonSyntax :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPythonSyntax
|
||||
/TestArchGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestArchGui
|
||||
/TestCAMGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestCAMGui
|
||||
/TestDraftGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestDraftGui
|
||||
/TestFemGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestFemGui
|
||||
/TestImportGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestImportGui
|
||||
/TestMaterialsGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestMaterialsGui
|
||||
/TestOpenSCADGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestOpenSCADGui
|
||||
/TestPartGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPartGui
|
||||
/TestPartDesignGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignGui
|
||||
/TestSketcherGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestSketcherGui
|
||||
/TestTechDrawGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawGui
|
||||
/Workbench :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Workbench
|
||||
/Menu :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Menu
|
||||
/Menu.MenuDeleteCases :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Menu.MenuDeleteCases
|
||||
/Menu.MenuCreateCases :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Menu.MenuCreateCases
|
||||
/GuiDocument :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t GuiDocument
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
summary:
|
||||
Run All FreeCAD python tests
|
||||
prepare:
|
||||
how: install
|
||||
package:
|
||||
- xorg-x11-server-Xvfb
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
@@ -0,0 +1,4 @@
|
||||
summary: Run All FreeCADCmd python tests
|
||||
test: /usr/bin/FreeCADCmd -v
|
||||
require: /usr/bin/FreeCADCmd
|
||||
duration: 1m
|
||||
@@ -36,6 +36,5 @@ if %ERRORLEVEL% neq 0 exit 1
|
||||
ninja -C build install
|
||||
if %ERRORLEVEL% neq 0 exit 1
|
||||
|
||||
rmdir /s /q "%LIBRARY_PREFIX%\doc"
|
||||
ren %LIBRARY_PREFIX%\bin\FreeCAD.exe freecad.exe
|
||||
ren %LIBRARY_PREFIX%\bin\FreeCADCmd.exe freecadcmd.exe
|
||||
|
||||
@@ -140,6 +140,7 @@ requirements:
|
||||
- blinker
|
||||
- calculix
|
||||
- debugpy
|
||||
- defusedxml
|
||||
- docutils
|
||||
- gmsh
|
||||
- graphviz
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
set -x
|
||||
|
||||
conda_env="fc_env"
|
||||
|
||||
@@ -46,6 +46,8 @@ cp -a ${conda_env}/Library/data ${copy_dir}/data
|
||||
cp -a ${conda_env}/Library/Ext ${copy_dir}/Ext
|
||||
cp -a ${conda_env}/Library/lib ${copy_dir}/lib
|
||||
cp -a ${conda_env}/Library/Mod ${copy_dir}/Mod
|
||||
mkdir -p ${copy_dir}/doc
|
||||
cp -a ${conda_env}/Library/doc/{ThirdPartyLibraries.html,LICENSE.html} ${copy_dir}/doc
|
||||
rm -rf ${conda_env}/bin_tmp
|
||||
|
||||
# Apply Patches
|
||||
|
||||
@@ -53,6 +53,7 @@ packages=(
|
||||
pyqt5-dev-tools
|
||||
pyside2-tools
|
||||
python3-dev
|
||||
python3-defusedxml
|
||||
python3-git
|
||||
python3-markdown
|
||||
python3-matplotlib
|
||||
|
||||
@@ -63,6 +63,7 @@ environments:
|
||||
- conda: https://conda.anaconda.org/conda-forge/linux-64/dav1d-1.2.1-hd590300_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/linux-64/dbus-1.16.2-h3c4dab8_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/linux-64/debugpy-1.8.15-py311hc665b79_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/defusedxml-0.7.1-pyhd8ed1ab_0.tar.bz2
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/linux-64/double-conversion-3.3.1-h5888daf_0.conda
|
||||
@@ -489,6 +490,7 @@ environments:
|
||||
- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/dav1d-1.2.1-h31becfc_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/dbus-1.16.2-heda779d_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/debugpy-1.8.15-py311h8e4e6a5_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/defusedxml-0.7.1-pyhd8ed1ab_0.tar.bz2
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/linux-aarch64/double-conversion-3.3.1-h5ad3122_0.conda
|
||||
@@ -903,6 +905,7 @@ environments:
|
||||
- conda: https://conda.anaconda.org/conda-forge/osx-64/dav1d-1.2.1-h0dc2134_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/osx-64/dbus-1.16.2-h27bd348_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/osx-64/debugpy-1.8.15-py311hc651eee_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/defusedxml-0.7.1-pyhd8ed1ab_0.tar.bz2
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/osx-64/double-conversion-3.3.1-h240833e_0.conda
|
||||
@@ -1232,6 +1235,7 @@ environments:
|
||||
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/dav1d-1.2.1-hb547adb_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/dbus-1.16.2-hda038a8_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/debugpy-1.8.15-py311ha59bd64_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/defusedxml-0.7.1-pyhd8ed1ab_0.tar.bz2
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/osx-arm64/double-conversion-3.3.1-h286801f_0.conda
|
||||
@@ -1544,6 +1548,7 @@ environments:
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/cycler-0.12.1-pyhd8ed1ab_1.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/win-64/dav1d-1.2.1-hcfcfb64_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/win-64/debugpy-1.8.15-py311h5dfdfe8_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/defusedxml-0.7.1-pyhd8ed1ab_0.tar.bz2
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/docutils-0.21.2-pyhd8ed1ab_1.conda
|
||||
- conda: https://conda.anaconda.org/conda-forge/win-64/double-conversion-3.3.1-he0c23c2_0.conda
|
||||
@@ -4622,6 +4627,17 @@ packages:
|
||||
- pkg:pypi/debugpy?source=hash-mapping
|
||||
size: 3932954
|
||||
timestamp: 1752827138613
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/defusedxml-0.7.1-pyhd8ed1ab_0.tar.bz2
|
||||
sha256: 9717a059677553562a8f38ff07f3b9f61727bd614f505658b0a5ecbcf8df89be
|
||||
md5: 961b3a227b437d82ad7054484cfa71b2
|
||||
depends:
|
||||
- python >=3.6
|
||||
license: PSF-2.0
|
||||
license_family: PSF
|
||||
purls:
|
||||
- pkg:pypi/defusedxml?source=hash-mapping
|
||||
size: 24062
|
||||
timestamp: 1615232388757
|
||||
- conda: https://conda.anaconda.org/conda-forge/noarch/distlib-0.4.0-pyhd8ed1ab_0.conda
|
||||
sha256: 6d977f0b2fc24fee21a9554389ab83070db341af6d6f09285360b2e09ef8b26e
|
||||
md5: 003b8ba0a94e2f1e117d0bd46aebc901
|
||||
|
||||
@@ -16,6 +16,7 @@ coin3d = "*"
|
||||
compilers = ">=1.10,<1.11"
|
||||
conda-devenv = "*"
|
||||
debugpy = "*"
|
||||
defusedxml = "*"
|
||||
docutils = "*"
|
||||
doxygen = "*"
|
||||
eigen = "*"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
function git_commit_no {
|
||||
commits=$(curl -s 'https://api.github.com/repos/FreeCAD/FreeCAD/compare/120ca87015...main' | grep "\"ahead_by\":" | sed -s 's/ //g' | sed -s 's/"ahead_by"://' | sed -s 's/,//')
|
||||
echo -n $((commits + 1))
|
||||
}
|
||||
Vendored
+1
-1
Submodule src/3rdParty/GSL updated: 2828399820...543d0dd3fe
Vendored
+1
-1
Submodule src/3rdParty/OndselSolver updated: bacb65f9c0...30e9b64e8b
+4
@@ -133,6 +133,10 @@
|
||||
typedef long int Py_hash_t;
|
||||
#endif
|
||||
|
||||
#if PY_VERSION_HEX >= 0x030d0000
|
||||
#define Py_UNICODE_DEPRECATED
|
||||
#endif
|
||||
|
||||
#ifndef PYCXX_PYTHON_2TO3
|
||||
#define PYCXX_PYTHON_2TO3
|
||||
#endif
|
||||
|
||||
+8
-8
@@ -1783,7 +1783,7 @@ namespace Py
|
||||
// Python strings return strings as individual elements.
|
||||
// I'll try having a class Char which is a String of length 1
|
||||
//
|
||||
#if !defined(Py_LIMITED_API)
|
||||
#if !defined(Py_LIMITED_API) && !defined(Py_UNICODE_DEPRECATED)
|
||||
typedef std::basic_string<Py_UNICODE> unicodestring;
|
||||
extern Py_UNICODE unicode_null_string[1];
|
||||
#endif
|
||||
@@ -1979,7 +1979,7 @@ namespace Py
|
||||
validate();
|
||||
}
|
||||
|
||||
#if !defined( Py_LIMITED_API )
|
||||
#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
|
||||
Char( Py_UNICODE v )
|
||||
: Object( PyUnicode_FromOrdinal( v ), true )
|
||||
{
|
||||
@@ -1987,7 +1987,7 @@ namespace Py
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined( Py_LIMITED_API )
|
||||
#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
|
||||
Char( const unicodestring &v )
|
||||
: Object( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast<Py_UNICODE*>( v.data() ),1 ), true )
|
||||
{
|
||||
@@ -2008,7 +2008,7 @@ namespace Py
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if !defined( Py_LIMITED_API )
|
||||
#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
|
||||
Char &operator=( const unicodestring &v )
|
||||
{
|
||||
set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast<Py_UNICODE*>( v.data() ), 1 ), true );
|
||||
@@ -2016,7 +2016,7 @@ namespace Py
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined( Py_LIMITED_API )
|
||||
#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
|
||||
Char &operator=( int v_ )
|
||||
{
|
||||
Py_UNICODE v( v_ );
|
||||
@@ -2025,7 +2025,7 @@ namespace Py
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined( Py_LIMITED_API )
|
||||
#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
|
||||
Char &operator=( Py_UNICODE v )
|
||||
{
|
||||
set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, &v, 1 ), true );
|
||||
@@ -2164,7 +2164,7 @@ namespace Py
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined( Py_LIMITED_API )
|
||||
#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
|
||||
String( const Py_UNICODE *s, int length )
|
||||
: SeqBase<Char>( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, s, length ), true )
|
||||
{
|
||||
@@ -2185,7 +2185,7 @@ namespace Py
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if !defined( Py_LIMITED_API )
|
||||
#if !defined( Py_LIMITED_API ) && !defined(Py_UNICODE_DEPRECATED)
|
||||
String &operator=( const unicodestring &v )
|
||||
{
|
||||
set( PyUnicode_FromKindAndData( PyUnicode_4BYTE_KIND, const_cast<Py_UNICODE *>( v.data() ), v.length() ), true );
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ Py_ssize_t numeric_limits_max()
|
||||
return std::numeric_limits<Py_ssize_t>::max();
|
||||
}
|
||||
|
||||
#if !defined(Py_LIMITED_API)
|
||||
#if !defined(Py_LIMITED_API) && !defined(Py_UNICODE_DEPRECATED)
|
||||
Py_UNICODE unicode_null_string[1] = { 0 };
|
||||
#endif
|
||||
char32_t ucs4_null_string[1] = { 0 };
|
||||
|
||||
Vendored
+2
@@ -38,6 +38,8 @@
|
||||
#ifndef __PyCXX_wrap_python_hxx__
|
||||
#define __PyCXX_wrap_python_hxx__
|
||||
|
||||
#include <FCConfig.h>
|
||||
|
||||
// On some platforms we have to include time.h to get select defined
|
||||
#if !defined(__WIN32__) && !defined(WIN32) && !defined(_WIN32) && !defined(_WIN64)
|
||||
#include <sys/time.h>
|
||||
|
||||
+36
-30
@@ -7,7 +7,7 @@ AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: true
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
@@ -24,19 +24,20 @@ AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterClass: true
|
||||
BitFieldColonSpacing: Both
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: true
|
||||
AfterClass: true
|
||||
AfterControlStatement: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
@@ -48,28 +49,32 @@ BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: AfterColon
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 120
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
ColumnLimit: 100
|
||||
CommentPragmas: '@copydetails '
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 3
|
||||
ContinuationIndentWidth: 3
|
||||
Cpp11BracedListStyle: false
|
||||
DeriveLineEnding: false
|
||||
DerivePointerAlignment: false
|
||||
EmptyLineBeforeAccessModifier: LogicalBlock
|
||||
EmptyLineAfterAccessModifier: Never
|
||||
FixNamespaceComments: false
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 3
|
||||
IndentWidth: 3
|
||||
IndentWrappedFunctionNames: true
|
||||
InsertBraces: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
Language: Cpp
|
||||
MaxEmptyLinesToKeep: 1
|
||||
@@ -83,13 +88,14 @@ PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 1000
|
||||
PointerAlignment: Right
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: true
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCaseColon: false
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
@@ -97,12 +103,12 @@ SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: true
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
TabWidth: 3
|
||||
UseTab: Never
|
||||
...
|
||||
Standard: c++14
|
||||
TabWidth: 3
|
||||
UseCRLF: false
|
||||
UseTab: Never
|
||||
|
||||
+135
-44
@@ -4,67 +4,151 @@ on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.config.name }} (${{ matrix.build_type }})
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build_type: ["Debug", "Release"]
|
||||
config:
|
||||
- {
|
||||
name: "macOS Clang",
|
||||
os: macos-latest,
|
||||
}
|
||||
- {
|
||||
name: "Ubuntu GCC",
|
||||
os: ubuntu-latest,
|
||||
}
|
||||
- {
|
||||
name: "Windows MSVC",
|
||||
os: windows-latest,
|
||||
}
|
||||
include:
|
||||
- name: 🍏 macOS (Clang - Debug)
|
||||
os: macos-latest
|
||||
platform: macos
|
||||
build_type: Debug
|
||||
build_shared: OFF
|
||||
build_test: ON
|
||||
validation_level: 2
|
||||
- name: 🍏 macOS (Clang, no validation - Release)
|
||||
os: macos-latest
|
||||
platform: macos
|
||||
build_type: Release
|
||||
build_shared: OFF
|
||||
build_test: ON
|
||||
validation_level: 0 # build one with no validation
|
||||
- name: 🍏 macOS (Clang, Shared - Release)
|
||||
os: macos-latest
|
||||
platform: macos
|
||||
build_type: Release
|
||||
build_shared: ON
|
||||
build_test: ON
|
||||
validation_level: 2
|
||||
|
||||
- name: 🐧 Linux (GCC - Debug)
|
||||
os: ubuntu-latest
|
||||
platform: linux
|
||||
build_type: Debug
|
||||
build_shared: OFF
|
||||
build_test: ON
|
||||
validation_level: 2
|
||||
- name: 🐧 Linux (GCC, extra validation - Release)
|
||||
os: ubuntu-latest
|
||||
platform: linux
|
||||
build_type: Release
|
||||
build_shared: OFF
|
||||
build_test: ON
|
||||
validation_level: 1 # build one with basic validation
|
||||
- name: 🐧 Linux (GCC, Shared - Release)
|
||||
os: ubuntu-latest
|
||||
platform: linux
|
||||
build_type: Release
|
||||
build_shared: ON
|
||||
build_test: ON
|
||||
validation_level: 2
|
||||
|
||||
- name: 🪟 Windows (MSVC - Debug)
|
||||
os: windows-latest
|
||||
platform: windows
|
||||
arch: x86_64
|
||||
build_type: Debug
|
||||
build_debug: ON
|
||||
build_shared: OFF
|
||||
build_test: ON
|
||||
validation_level: 2
|
||||
- name: 🪟 Windows (MSVC [32-bit] - Debug)
|
||||
os: windows-latest
|
||||
platform: windows
|
||||
arch: x86
|
||||
build_type: Debug
|
||||
build_debug: ON
|
||||
build_shared: OFF
|
||||
build_test: OFF
|
||||
validation_level: 2
|
||||
- name: 🪟 Windows (MSVC - Release)
|
||||
os: windows-latest
|
||||
platform: windows
|
||||
arch: x86_64
|
||||
build_type: Release
|
||||
build_shared: OFF
|
||||
build_test: ON
|
||||
validation_level: 2
|
||||
- name: 🪟 Windows (MSVC, Shared - Release)
|
||||
os: windows-latest
|
||||
platform: windows
|
||||
arch: x86_64
|
||||
build_type: Release
|
||||
build_shared: ON
|
||||
build_test: ON
|
||||
validation_level: 2
|
||||
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout Test Data
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'asmaloney/libE57Format-test-data'
|
||||
path: libE57Format-test-data
|
||||
|
||||
- name: Install Dependencies (macOS)
|
||||
if: matrix.config.os == 'macos-latest'
|
||||
if: matrix.platform == 'macos'
|
||||
run: |
|
||||
brew install ninja xerces-c
|
||||
brew install ccache ninja xerces-c
|
||||
|
||||
- name: Install Dependencies (Ubuntu)
|
||||
if: matrix.config.os == 'ubuntu-latest'
|
||||
- name: Install Dependencies (Linux)
|
||||
if: matrix.platform == 'linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get install -y libxerces-c-dev ninja-build
|
||||
|
||||
- name: Install miniconda (Windows)
|
||||
if: matrix.config.os == 'windows-latest'
|
||||
uses: conda-incubator/setup-miniconda@v2
|
||||
with:
|
||||
auto-update-conda: true
|
||||
channels: conda-forge
|
||||
miniconda-version: 'latest'
|
||||
sudo apt-get install -y ccache libxerces-c-dev ninja-build
|
||||
sudo locale-gen fr_FR
|
||||
|
||||
- name: Install Dependencies (Windows)
|
||||
if: matrix.config.os == 'windows-latest'
|
||||
if: matrix.platform == 'windows'
|
||||
uses: conda-incubator/setup-miniconda@v3
|
||||
with:
|
||||
channels: conda-forge
|
||||
|
||||
- name: Install More Dependencies (Windows)
|
||||
if: matrix.platform == 'windows'
|
||||
shell: bash -el {0}
|
||||
run: |
|
||||
conda install -y ninja xerces-c
|
||||
conda install conda-forge::xerces-c
|
||||
choco upgrade ccache ninja
|
||||
ccache --version | head -n 1
|
||||
echo "ninja $(ninja --version)"
|
||||
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
max-size: '5G'
|
||||
key: ${{ matrix.os }}-${{ matrix.build_type }}
|
||||
|
||||
- name: Configure MSVC console (Windows)
|
||||
if: matrix.config.os == 'windows-latest'
|
||||
if: matrix.platform == 'windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: ${{ matrix.arch }}
|
||||
|
||||
- name: Set environment for MSVC (Windows)
|
||||
if: matrix.config.os == 'windows-latest'
|
||||
- name: Output conda info (Windows)
|
||||
if: matrix.platform == 'windows'
|
||||
run: |
|
||||
# Set these env vars so cmake picks the correct compiler
|
||||
echo "CXX=cl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
echo "CC=cl.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
conda info
|
||||
conda list
|
||||
conda config --show-sources
|
||||
conda config --show
|
||||
printenv | sort
|
||||
|
||||
- name: Configure
|
||||
run: >
|
||||
@@ -74,9 +158,16 @@ jobs:
|
||||
-B libE57Format-build
|
||||
-G "Ninja"
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
|
||||
-DCMAKE_CXX_FLAGS_DEBUG="-g -DE57_MAX_VERBOSE"
|
||||
-DE57_BUILD_SHARED=${{ matrix.build_shared }}
|
||||
-DE57_BUILD_TEST=${{ matrix.build_test }}
|
||||
-DE57_VALIDATION_LEVEL=${{ matrix.validation_level }}
|
||||
-DE57FORMAT_WARNING_AS_ERROR:BOOL=ON
|
||||
-DE57FORMAT_SANITIZE_ALL:BOOL=ON
|
||||
.
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build libE57Format-build
|
||||
run: cmake --build libE57Format-build
|
||||
|
||||
- name: Test
|
||||
if: matrix.build_test == 'ON'
|
||||
run: libE57Format-build/testE57
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
name: C++ Code Format
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
formatting-check:
|
||||
name: Formatting Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run clang-format style check
|
||||
uses: jidicula/clang-format-action@v4.15.0
|
||||
with:
|
||||
clang-format-version: '18'
|
||||
exclude-regex: 'extern'
|
||||
@@ -0,0 +1,3 @@
|
||||
build
|
||||
.vscode
|
||||
.cache
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
dist: xenial
|
||||
sudo: false
|
||||
language: cpp
|
||||
|
||||
env:
|
||||
global:
|
||||
# For coverity
|
||||
- secure: "Ddou0BLHkn4V8b/Q6E56lUVz4woSXS8eI0IzRxyYqkDvXtqqjSlxqtu2fuU/awieA6Y5rzEHZrpHnvJU80uC+gnlIfMkIU9O0Cj0rwppKTTTWpXzohrESfXzJc8iZs+3gxpReZhWp6IGrfitdudfpFAgLWBENgzemWsHy7prnDcQQA99FBUhCuhbqhtXRR8wxXUWNQr2RntbFbH22Eqcwbd5a+OYpPSCtV296ZII6/iskMI3OeXCEGnqKBxe2L9oohcrTS/0beCLM7dhCflelns8MTGa1AYmJEwXf3/n4PmwRo7EjTpSBow70n9SCps5mS42+wRDU8FMBTNgqzBNjOdDojrPhijnEPfhRzFygsyfgoEmuZjD2MuXBSIwpYa9mFusVpN2BON3zZLvmw5Y1HuBadf3yLoD0/Vy1K6YBnQRMIm5JhVYj4hY8ogtPNVfjYjckHEPlCRcwzS5rwh/sZ2eYW30LW3IusCB2wu3/iR97jamBu3sEOY67ln3M6EOjnMPHApBqsVhapQv+XtOtxaVPzKVc1u6tlzRRijPCfcN6ssNHzFh1feqFopthapY4erfA+DrjQivW+E49Yv306ig6HVBbrMkOR+TX+bgDmZisLtbJ8d2eym063KuojBRqDlq8wrz0MlUXVIz2H0FhXPIho8z9Uj7fkswM+jQiJc="
|
||||
matrix:
|
||||
- BUILD_TYPE=Debug
|
||||
- BUILD_TYPE=Release
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
before_install:
|
||||
- echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libxerces-c-dev
|
||||
coverity_scan:
|
||||
project:
|
||||
name: "asmaloney/libE57Format"
|
||||
description: "Library for reading & writing the E57 file format (fork of E57RefImpl) "
|
||||
notification_email: asmaloney@gmail.com
|
||||
build_command_prepend: "cmake -DCMAKE_BUILD_TYPE=Debug ."
|
||||
build_command: "make -j2"
|
||||
branch_pattern: coverity_scan
|
||||
|
||||
before_script:
|
||||
- mkdir build-${BUILD_TYPE}
|
||||
- cd build-${BUILD_TYPE}
|
||||
- cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_CXX_FLAGS_DEBUG="-g -DE57_MAX_VERBOSE" ..
|
||||
|
||||
script:
|
||||
- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then
|
||||
$CC_FOR_BUILD -v && $CXX_FOR_BUILD -v && cmake --version;
|
||||
make -j2;
|
||||
fi
|
||||
+207
-4
@@ -1,16 +1,219 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
## 3.3.0 - (in progress)
|
||||
|
||||
## 2.2.1 - (in progress)
|
||||
### Added
|
||||
|
||||
- {cmake} Generate a package version file ([#316](https://github.com/asmaloney/libE57Format/pull/316)) (Thanks SunBlack!)
|
||||
|
||||
### Changed
|
||||
|
||||
- {cmake} Require XercesC 3.2 and remove `USING_STATIC_XERCES` ([#317](https://github.com/asmaloney/libE57Format/pull/317)) (Thanks SunBlack!)
|
||||
|
||||
### Fixed
|
||||
|
||||
- {cmake} Added missing include for GNUInstallDirs ([#315](https://github.com/asmaloney/libE57Format/pull/315)) (Thanks Adrian!)
|
||||
|
||||
If you built without testing on, the cmake files were not installed to the correct location.
|
||||
|
||||
## [3.2.0](https://github.com/asmaloney/libE57Format/releases/tag/v3.2.0) - 2024-06-27
|
||||
|
||||
### Added
|
||||
|
||||
- {cmake} Added `E57_INSTALL_CMAKEDIR` option to override where the cmake files are installed. ([#305](https://github.com/asmaloney/libE57Format/pull/305))
|
||||
|
||||
This defaults to `lib/cmake/E57Format` and the path is relative to `CMAKE_INSTALL_PREFIX`.
|
||||
|
||||
### Changed
|
||||
|
||||
- {cmake} If building as a shared library, set [VERSION](https://cmake.org/cmake/help/v3.15/prop_tgt/VERSION.html) & [SOVERSION](https://cmake.org/cmake/help/v3.15/prop_tgt/SOVERSION.html). ([#304](https://github.com/asmaloney/libE57Format/pull/304))
|
||||
- {cmake} Don't force warnings as errors when building self. ([#299](https://github.com/asmaloney/libE57Format/pull/299))
|
||||
- {cmake} Use git tag in library version for more precision. ([#298](https://github.com/asmaloney/libE57Format/pull/298))
|
||||
- {license} Re-license all my (asmaloney) MIT files to BSL-1.0. It is just easier to have it all under one license. ([#296](https://github.com/asmaloney/libE57Format/pull/296))
|
||||
- {format} Update to clang-format 18 & reformat code. ([#286](https://github.com/asmaloney/libE57Format/pull/286))
|
||||
- Add "E57\_" to macros in E57Exception.h. ([#285](https://github.com/asmaloney/libE57Format/pull/285))
|
||||
- "De-deprecate" methods in **E57SimpleWriter**. These methods can be useful when writing batches. ([#284](https://github.com/asmaloney/libE57Format/pull/284))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Update CRCpp to fix MSVC and MinGW warnings. ([#302](https://github.com/asmaloney/libE57Format/pull/302))
|
||||
- Fix warnings about redefinition of `_LARGEFILE64_SOURCE` and `__LARGE64_FILES` ([#301](https://github.com/asmaloney/libE57Format/pull/301)) (Thanks Niklas!)
|
||||
- Fix building with emscripten. (Note that the project doesn't officially support emscripten.) ([#288](https://github.com/asmaloney/libE57Format/pull/288)) (Thanks maz-1!)
|
||||
- {standard conformance} CompressedVectors always write an index packet. This is required by the standard (9.3.5). ([#295](https://github.com/asmaloney/libE57Format/pull/295))
|
||||
- {standard conformance} **E57SimpleReader** accepts files containing zero scans. ([#283](https://github.com/asmaloney/libE57Format/pull/283))
|
||||
- {cmake} Replace deprecated "exec_program" with "execute_process". ([#282](https://github.com/asmaloney/libE57Format/pull/282))
|
||||
- Fix potential invalid range exceptions when reading integer nodes. ([#278](https://github.com/asmaloney/libE57Format/pull/278))
|
||||
|
||||
## [3.1.1](https://github.com/asmaloney/libE57Format/releases/tag/v3.1.1) - 2023-11-28
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix library version in CMakeLists.txt. (Thanks Olli!)
|
||||
|
||||
## [3.1.0](https://github.com/asmaloney/libE57Format/releases/tag/v3.1.0) - 2023-11-20
|
||||
|
||||
### Added
|
||||
|
||||
- {cmake} New option `E57_RELEASE_LTO` controls whether link-time optimization is on for release builds. It defaults to `ON`. ([#254](https://github.com/asmaloney/libE57Format/pull/254))
|
||||
|
||||
CMake forces "thin" LTO (see [this issue](https://gitlab.kitware.com/cmake/cmake/-/issues/23136)) which is a problem if compiling statically for distribution (e.g. in a package manager). Generally you will only want to turn this off for distributing static release builds.
|
||||
|
||||
### Changed
|
||||
|
||||
- Trying to read a Data3D with zero records which has an ill-formed header will now throw an `ErrorData3DReadInvalidZeroRecords` exception instead of `ErrorInternal`. ([#264](https://github.com/asmaloney/libE57Format/pull/264))
|
||||
> Note that previous versions of this library (and E57RefImpl itself) could write these headers incorrectly. This was also fixed in this release (see below).
|
||||
- {cmake} Remove `E57_VISIBILITY_HIDDEN` option. ([#259](https://github.com/asmaloney/libE57Format/pull/259))
|
||||
|
||||
I cannot get extern templates to work across all of gcc, clang, apple clang, and MSVC when using "hidden" visibility with shared libraries.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix #include to avoid MSVC compilation error with Visual Studio 2017 ([#268](https://github.com/asmaloney/libE57Format/pull/268)) (Thanks Thomas!)
|
||||
- {standard conformance} A compressed vector with 0 records must still write a data packet. ([#266](https://github.com/asmaloney/libE57Format/pull/266))
|
||||
- {standard conformance} Fix reading a compressed vector with 0 points which has an empty data packet. ([#267](https://github.com/asmaloney/libE57Format/pull/267))
|
||||
- {standard conformance} Compressed vectors with an invalid section ID now throw an `ErrorBadCVPacket` exception if `E57_VALIDATION_LEVEL` > 0. ([#265](https://github.com/asmaloney/libE57Format/pull/265))
|
||||
- Fix clang warnings about implicit conversions in _SourceDestBufferImpl.cpp_. Apple's clang doesn't warn about these, but it looks like the official clang releases do. ([#257](https://github.com/asmaloney/libE57Format/pull/257)) (Thanks Martin!)
|
||||
|
||||
## [3.0.2](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.2) - 2023-07-22
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix `E57_VERBOSE` build. ([#251](https://github.com/asmaloney/libE57Format/pull/251)) (Thanks Jia!)
|
||||
- {standard conformance} Fix invalid range exception in FloatNode implementation. ([#250](https://github.com/asmaloney/libE57Format/pull/250))
|
||||
- Fix reading of index packets. ([#249](https://github.com/asmaloney/libE57Format/pull/249))
|
||||
- Fix several places where we should be checking for MSVC, not WIN32. ([#248](https://github.com/asmaloney/libE57Format/pull/248))
|
||||
- Fix "unnecessary semicolons" warnings which prevented building with GCC <= 10. ([#241](https://github.com/asmaloney/libE57Format/pull/241)) (Thanks Andre!)
|
||||
|
||||
## [3.0.1](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.1) - 2023-03-15
|
||||
|
||||
### Added
|
||||
|
||||
- {ci} Added an MSVC 32-bit build. ([#235](https://github.com/asmaloney/libE57Format/pull/235))
|
||||
|
||||
### Fixed
|
||||
|
||||
- {cmake} Turn off inter-procedural optimization in debug builds. Link-time optimization can make debugging more difficult. ([#240](https://github.com/asmaloney/libE57Format/pull/240))
|
||||
- {cmake} Don't force a debug postfix if `CMAKE_DEBUG_POSTFIX` is defined.([#239](https://github.com/asmaloney/libE57Format/pull/239))
|
||||
- {cmake} Don't force install locations. This prevents overriding them using `CMAKE_INSTALL_BINDIR` & `CMAKE_INSTALL_LIBDIR`.([#237](https://github.com/asmaloney/libE57Format/pull/237))
|
||||
- Fix warnings which prevented building on 32-bit systems. ([#233](https://github.com/asmaloney/libE57Format/pull/233), [#234](https://github.com/asmaloney/libE57Format/pull/234))
|
||||
|
||||
## [3.0.0](https://github.com/asmaloney/libE57Format/releases/tag/v3.0.0) - 2023-02-23
|
||||
|
||||
There have been _many_ changes around the `Simple API` in this release to fix some problems, avoid potential errors, and simplify the use of the API. Where possible these changes are marked as `deprecated` to be removed later. The compiler will produce warnings for these indicating what needs to change. Other changes could not be marked deprecated but will break the API, requiring code changes. The notable ones are marked with 🚧 below.
|
||||
|
||||
### Added
|
||||
|
||||
- Add address (ASan) and undefined behaviour (UBSan) sanitizers. These are controlled by `E57FORMAT_SANITIZE_ALL`, `E57FORMAT_SANITIZE_ADDRESS` and `E57FORMAT_SANITIZE_ADDRESS`. They are not included when building with MSVC.
|
||||
- Add new `E57Version.h` header for more convenient access to version information. ([#197](https://github.com/asmaloney/libE57Format/pull/197)).
|
||||
- Add `ImageFile::extensionsLookupPrefix()` overload for more concise user code. ([#161](https://github.com/asmaloney/libE57Format/pull/161))
|
||||
- Added a constructor & destructor for **E57SimpleData**'s `Data3DPointsData_t`. This will create all the required buffers based on an `e57::Data3D` struct and handle their cleanup. See the `SimpleWriter` tests for examples. ([#149](https://github.com/asmaloney/libE57Format/pull/149))
|
||||
|
||||
> **Note:** I strongly recommend these new constructors be used to simplify your code and help prevent errors.
|
||||
|
||||
- A new **E57SimpleReader** constructor takes a `ReaderOptions` struct which allows setting the checksum policy.
|
||||
```cpp
|
||||
Reader( const ustring &filePath, const ReaderOptions &options );
|
||||
```
|
||||
- {test} Added testing using [GoogleTest](https://github.com/google/googletest). For details, please see [test/README.md](test/README.md) ([#121](https://github.com/asmaloney/libE57Format/pull/121))
|
||||
- Added `E57Exception::errorStr()` to get the error string directly. ([#128](https://github.com/asmaloney/libE57Format/pull/128))
|
||||
- {cmake} Use [ccache](https://ccache.dev/) if available. ([#129](https://github.com/asmaloney/libE57Format/pull/129))
|
||||
- {ci} Added a CI check for proper clang-formatted code. ([#125](https://github.com/asmaloney/libE57Format/pull/125))
|
||||
|
||||
### Changed
|
||||
|
||||
- Now requires a **[C++14](https://en.cppreference.com/w/cpp/14)** compatible compiler.
|
||||
- Now requires **[CMake](https://cmake.org/) >= 3.15**. ([#205](https://github.com/asmaloney/libE57Format/pull/205))
|
||||
- 🚧 **DEBUG** and **VERBOSE** macros were changed to simplify and clarify:
|
||||
- New `E57_ENABLE_DIAGNOSTIC_OUTPUT` controls the inclusion of the code for the `dump()` functions on nodes. I don't see any real reason to turn this off, but I left the capability in for compatibility.
|
||||
- New `E57_VALIDATION_LEVEL=N` replaces `E57_DEBUG` (N=1) and `E57_MAX_DEBUG` (N=2).
|
||||
- `E57_MAX_VERBOSE` was consolidated with `E57_VERBOSE` since they were essentially the same.
|
||||
- When building itself, warnings are now treated as errors. ([#205](https://github.com/asmaloney/libE57Format/pull/205), [#211](https://github.com/asmaloney/libE57Format/pull/211))
|
||||
- Clean up global const and enum names to use the `e57` namespace and avoid repetition. ([#176](https://github.com/asmaloney/libE57Format/pull/176))
|
||||
- i.e. instead of `e57::E57_STRUCTURE`, we now use `e57::TypeStructure`
|
||||
- {format} Update clang-format rules for clang-format 15. ([#168](https://github.com/asmaloney/libE57Format/pull/168), [#179](https://github.com/asmaloney/libE57Format/pull/179))
|
||||
- Change default checksum policies to an enum. ([#166](https://github.com/asmaloney/libE57Format/pull/166))
|
||||
Old | New
|
||||
--|--
|
||||
CHECKSUM_POLICY_NONE | ChecksumPolicy::None
|
||||
CHECKSUM_POLICY_SPARSE | ChecksumPolicy::Sparse
|
||||
CHECKSUM_POLICY_HALF | ChecksumPolicy::Half
|
||||
CHECKSUM_POLICY_ALL | ChecksumPolicy::All
|
||||
- Avoid implicit conversion in constructors. ([#135](https://github.com/asmaloney/libE57Format/pull/135))
|
||||
- Update [CRCpp](https://github.com/d-bahr/CRCpp) to 1.2. ([#130](https://github.com/asmaloney/libE57Format/pull/130))
|
||||
- **E57Exception** changes ([#118](https://github.com/asmaloney/libE57Format/pull/118)):
|
||||
- mark methods as `noexcept`
|
||||
- use `private` instead of `protected`
|
||||
- Rename **E57Simple**'s `Data3DPointsData` and `Data3DPointsData_d` structs to `Data3DPointsFloat` and `Data3DPointsDouble` respectively. ([#180](https://github.com/asmaloney/libE57Format/pull/180))
|
||||
- 🚧 **E57Simple:** Specifying the node type for cartesian & spherical points, time stamp, and intensity is now explicit using new fields (`pointRangeNodeType`, `angleNodeType`, `timeNodeType`, and `intensityNodeType`) and a new enum (`NumericalNodeType`). ([#178](https://github.com/asmaloney/libE57Format/pull/178))
|
||||
- For examples, please see _test/src/testSimpleWriter.cpp_.
|
||||
- Simplify the **E57SimpleWriter** API with `WriteImage2DData()` for images and `WriteData3DData()` for 3D data. This reduces code, hides complexity, and avoids potential errors. ([#171](https://github.com/asmaloney/libE57Format/pull/171))
|
||||
- As part of this simplification, `WriteData3DData()` will now fill in any missing min/max values for cartesian & spherical points, intensity, and time stamps by looking at the data.([#175](https://github.com/asmaloney/libE57Format/pull/175))
|
||||
- 🚧 **E57Simple:** Intensity now uses `double` instead of `float`. ([#178](https://github.com/asmaloney/libE57Format/pull/178))
|
||||
- 🚧 **E57Simple:** Colours now use `uint16_t` instead of `uint8_t`. ([#167](https://github.com/asmaloney/libE57Format/pull/167))
|
||||
- 🚧 Change **E57SimpleData**'s Data3D field name from `pointsSize` to `pointCount`. ([#164](https://github.com/asmaloney/libE57Format/pull/164))
|
||||
- 🚧 Min/max fields in **E57SimpleData**'s Data3D's point fields were a mix of floats and doubles. Since the fields are doubles, set them all to doubles and use the new `Data3DPointsData_t` constructor to set them properly for floats. ([#153](https://github.com/asmaloney/libE57Format/pull/153))
|
||||
> **Note:** If you were previously relying on these to be floats and are not using the new `Data3DPointsData_t` constructor, you will need to set these.
|
||||
- 🚧 Renamed the [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension's fields in **E57SimpleData**'s `PointStandardizedFieldsAvailable` to be in line with existing code. ([#149](https://github.com/asmaloney/libE57Format/pull/149))
|
||||
- `normalX` renamed to `normalXField`
|
||||
- `normalY` renamed to `normalYField`
|
||||
- `normalZ` renamed to `normalZField`
|
||||
|
||||
### Deprecated
|
||||
|
||||
- `e57::Utilities::getVersions()`. ([#197](https://github.com/asmaloney/libE57Format/pull/197))
|
||||
- `e57::Data3DPointsData` and `e57::Data3DPointsData_d` types. ([#180](https://github.com/asmaloney/libE57Format/pull/180))
|
||||
- Many global const and enum names. The compiler will produce warnings including the replacement symbols (note that enumerators will not produce warnings on C++14, but they will on C++17). ([#176](https://github.com/asmaloney/libE57Format/pull/176))
|
||||
- `e57::Writer::NewImage2D`and `e57::Writer::SetUpData3DPointsData`. ([#171](https://github.com/asmaloney/libE57Format/pull/171))
|
||||
- Old default checksum policies (`CHECKSUM_POLICY_NONE`, `CHECKSUM_POLICY_SPARSE`, `CHECKSUM_POLICY_HALF`, and `CHECKSUM_POLICY_ALL`). ([#166](https://github.com/asmaloney/libE57Format/pull/166))
|
||||
- The old `e57::Reader` constructor taking only `filePath`. ([#139](https://github.com/asmaloney/libE57Format/pull/139))
|
||||
- The old `e57::Writer` constructor taking only `filePath`. ([#117](https://github.com/asmaloney/libE57Format/pull/117))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix several potential divide-by-zero cases. ([#224](https://github.com/asmaloney/libE57Format/pull/224))
|
||||
- {ci} Now builds shared library versions as well. ([#219](https://github.com/asmaloney/libE57Format/pull/219))
|
||||
- {win} Fixes shared library build warnings. ([#215](https://github.com/asmaloney/libE57Format/pull/215), [#216](https://github.com/asmaloney/libE57Format/pull/216), [#217](https://github.com/asmaloney/libE57Format/pull/217))
|
||||
- Fix the code which shortens floating point numbers when converted to strings. The impact of it being incorrect was negligible since it's just the floating point representation in the XML portion of the file. ([#214](https://github.com/asmaloney/libE57Format/pull/214))
|
||||
- Turned on a lot of compiler warnings and fixed them. ([#201](https://github.com/asmaloney/libE57Format/pull/201), [#202](https://github.com/asmaloney/libE57Format/pull/202), [#203](https://github.com/asmaloney/libE57Format/pull/203), [#204](https://github.com/asmaloney/libE57Format/pull/204), [#205](https://github.com/asmaloney/libE57Format/pull/205), [#207](https://github.com/asmaloney/libE57Format/pull/207), [#209](https://github.com/asmaloney/libE57Format/pull/209))
|
||||
- Fix writing floating point numbers when `std::locale::global` is set. ([#174](https://github.com/asmaloney/libE57Format/pull/174))
|
||||
- E57XmlParser: Parse doubles in a locale-independent way. ([#173](https://github.com/asmaloney/libE57Format/pull/173)) (Thanks Hugal31!)
|
||||
- E57SimpleReader: Ensure scaled integer fields are set as best we can when reading. ([#158](https://github.com/asmaloney/libE57Format/pull/158))
|
||||
- Fix the [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension's URI in **E57SimpleWriter**. ([#143](https://github.com/asmaloney/libE57Format/pull/143))
|
||||
- {win} Fix conversion warning when compiling with debug on. ([#124](https://github.com/asmaloney/libE57Format/pull/124))
|
||||
- Add errno detail to `E57_ERROR_OPEN_FAILED` exception. ([#119](https://github.com/asmaloney/libE57Format/pull/119), [#120](https://github.com/asmaloney/libE57Format/pull/120))
|
||||
|
||||
## [2.3.0](https://github.com/asmaloney/libE57Format/releases/tag/v2.3.0) - 2022-10-04
|
||||
|
||||
### Added
|
||||
|
||||
- {cmake} Added `E57_VISIBILITY_HIDDEN` option to control [CXX_VISIBILITY_PRESET](https://cmake.org/cmake/help/latest/prop_tgt/LANG_VISIBILITY_PRESET.html). Defaults to `ON`. ([#104](https://github.com/asmaloney/libE57Format/pull/104)) (Thanks Nigel!)
|
||||
- Added BSD support. ([#99](https://github.com/asmaloney/libE57Format/pull/99)) (Thanks Christophe!)
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated & reorganized the [online API docs](https://asmaloney.github.io/libE57Format-docs/) and changed to a [cleaner theme](https://github.com/jothepro/doxygen-awesome-css).
|
||||
- Change file creation to use _0666_ permissions on [POSIX](https://en.wikipedia.org/wiki/POSIX) systems. ([#105](https://github.com/asmaloney/libE57Format/pull/105)) (Thanks Nigel!)
|
||||
- {cmake} [CXX_VISIBILITY_PRESET](https://cmake.org/cmake/help/latest/prop_tgt/LANG_VISIBILITY_PRESET.html) is now set and `ON` by default. ([#104](https://github.com/asmaloney/libE57Format/pull/104)) (Thanks Nigel!)
|
||||
- A new **E57SimpleWriter** constructor takes a `WriterOptions` struct which allows setting the file's GUID.
|
||||
```cpp
|
||||
Writer( const ustring &filePath, const WriterOptions &options );
|
||||
```
|
||||
The old constructor taking only `coordinateMetadata` is deprecated and will be removed in the future. ([#96](https://github.com/asmaloney/libE57Format/pull/96)) (Thanks Nigel!)
|
||||
- Change `E57_DEBUG`, `E57_MAX_DEBUG`, `E57_VERBOSE`, `E57_MAX_VERBOSE`, `E57_WRITE_CRAZY_PACKET_MODE` from **#defines** to cmake options. ([#80](https://github.com/asmaloney/libE57Format/pull/80)) (Thanks Nigel!)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix **E57SimpleWriter**'s writing of invalid quaternions. It now defaults to the identity quaternion. ([#108](https://github.com/asmaloney/libE57Format/pull/108)) (Thanks Nigel!)
|
||||
- Fix **E57SimpleReader** to handle missing `images2D` and `isAtomicClockReferenced` nodes. ([#90](https://github.com/asmaloney/libE57Format/pull/90)) (Thanks Olli!)
|
||||
- Fix **BitpackIntegerDecoder** sometimes reading past end of input buffer. ([#87](https://github.com/asmaloney/libE57Format/pull/87)) (Thanks Nigel!)
|
||||
- Fix compilation when some debug options are set. ([#81](https://github.com/asmaloney/libE57Format/pull/81), [#82](https://github.com/asmaloney/libE57Format/pull/82), [#84](https://github.com/asmaloney/libE57Format/pull/84)) (Thanks Nigel!)
|
||||
- Fix compilation with [musl libc](https://musl.libc.org/) ([#70](https://github.com/asmaloney/libE57Format/pull/70)) (Thanks Dimitri!)
|
||||
- Add missing include for [GCC 11](https://gcc.gnu.org/gcc-11/porting_to.html#header-dep-changes) ([#68](https://github.com/asmaloney/libE57Format/pull/68)) (Thanks bartoszek!)
|
||||
|
||||
**Note:** The next release will be 3.0 and will require a [C++14](https://en.cppreference.com/w/cpp/14) compiler.
|
||||
|
||||
## [2.2.0](https://github.com/asmaloney/libE57Format/releases/tag/v2.2.0) - 2021-04-01
|
||||
|
||||
### Added
|
||||
@@ -35,7 +238,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
### Other
|
||||
|
||||
- Removed all internal usage of dynamic_cast<>. ([#39](https://github.com/asmaloney/libE57Format/pull/39)) (Thanks Jiri!)
|
||||
- Split classes out from E57FormatImpl.[h,cpp] intot their own files.
|
||||
- Split classes out from E57FormatImpl.[h,cpp] into their own files.
|
||||
|
||||
## [2.1.0](https://github.com/asmaloney/libE57Format/releases/tag/v2.1) - 2020-04-01
|
||||
|
||||
|
||||
+142
-83
@@ -3,8 +3,8 @@
|
||||
#
|
||||
# Use git blame to see all the changes and who has contributed.
|
||||
#
|
||||
# Copyright 2018-2023 Andy Maloney <asmaloney@gmail.com>
|
||||
# Original work Copyright 2010-2012 Roland Schwarz, Riegl LMS GmbH
|
||||
# Modified work Copyright 2018-2020 Andy Maloney <asmaloney@gmail.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person or organization
|
||||
# obtaining a copy of the software and accompanying documentation covered by
|
||||
@@ -28,10 +28,12 @@
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
|
||||
cmake_minimum_required( VERSION 3.10.0 )
|
||||
cmake_minimum_required( VERSION 3.15 )
|
||||
|
||||
# Set a private module find path
|
||||
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/" )
|
||||
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" )
|
||||
|
||||
message( STATUS "Using CMake ${CMAKE_VERSION}" )
|
||||
|
||||
project( E57Format
|
||||
DESCRIPTION
|
||||
@@ -39,10 +41,20 @@ project( E57Format
|
||||
LANGUAGES
|
||||
CXX
|
||||
VERSION
|
||||
2.2.1
|
||||
3.2.0
|
||||
)
|
||||
|
||||
string( TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE )
|
||||
|
||||
# Creates a build tag which is used in the REVISION_ID
|
||||
# e.g. "x86_64-darwin-AppleClang140"
|
||||
include( Tags )
|
||||
include( GitInfo )
|
||||
|
||||
# Collect all our current git info using:
|
||||
# https://github.com/cppmf/GitInfo.cmake
|
||||
GitInfo( ${CMAKE_CURRENT_SOURCE_DIR} )
|
||||
# GitInfoReport()
|
||||
|
||||
# Check if we are building ourself or being included and use this to set some defaults
|
||||
if ( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
|
||||
@@ -65,7 +77,7 @@ if ( E57_BUILDING_SELF )
|
||||
endif()
|
||||
|
||||
find_package( Threads REQUIRED )
|
||||
find_package( XercesC REQUIRED )
|
||||
find_package( XercesC 3.2 REQUIRED )
|
||||
|
||||
option( E57_BUILD_SHARED
|
||||
"Compile E57Format as a shared library"
|
||||
@@ -77,105 +89,116 @@ if( BUILD_SHARED_LIBS )
|
||||
endif()
|
||||
|
||||
#########################################################################################
|
||||
|
||||
# Various levels of cross checking and verification in the code.
|
||||
# Cross checking and runtime verification in the code.
|
||||
# The extra code does not change the file contents.
|
||||
# Recommend that E57_DEBUG remain defined even for production versions.
|
||||
# E57_VALIDATION_LEVEL=0 off
|
||||
# E57_VALIDATION_LEVEL=1 basic
|
||||
# E57_VALIDATION_LEVEL=2 deep (implies basic) - checks at the packet level, so it will be slower
|
||||
set( E57_VALIDATION_LEVEL "1" CACHE STRING "Runtime validation level (0 = OFF, 1 = basic, 2 = deep)" )
|
||||
|
||||
option( E57_DEBUG "Compile library with minimal debug checking" ON )
|
||||
option( E57_MAX_DEBUG "Compile library with maximum debug checking" OFF )
|
||||
# Output detailed logging while processing.
|
||||
option( E57_VERBOSE "Compile library with verbose logging" OFF )
|
||||
|
||||
# Various levels of printing to the console of what is going on in the code.
|
||||
# Optional
|
||||
|
||||
option( E57_VERBOSE "Compile library with verbose logging" OFF )
|
||||
option( E57_MAX_VERBOSE "Compile library with maximum verbose logging" OFF )
|
||||
# Enable/disable code which dumps detailed node info to std::ostream. (See NodeImpl::dump())
|
||||
# Instead of always including this code, it is an option for backwards compatibility.
|
||||
# The only real reason to turn this off would be for slightly smaller binaries.
|
||||
option( E57_ENABLE_DIAGNOSTIC_OUTPUT "Include code for diagnostic output using dump() on nodes" ON )
|
||||
|
||||
# Enable writing packets that are correct but will stress the reader.
|
||||
|
||||
option( E57_WRITE_CRAZY_PACKET_MODE "Compile library to enable reader-stressing packets" OFF )
|
||||
|
||||
# Other compile options
|
||||
|
||||
# Link-time optiomization
|
||||
# CMake forces "thin" LTO (see https://gitlab.kitware.com/cmake/cmake/-/issues/23136)
|
||||
# which is a problem if compiling statically for distribution (e.g. in a package manager).
|
||||
# Generally you will only want to turn this off for distributing static release builds.
|
||||
option( E57_RELEASE_LTO "Compile release library with link-time optimization" ON )
|
||||
|
||||
#########################################################################################
|
||||
|
||||
set( revision_id "${PROJECT_NAME}-${PROJECT_VERSION}-${${PROJECT_NAME}_BUILD_TAG}" )
|
||||
message( STATUS "[E57] Revision ID: ${revision_id}" )
|
||||
|
||||
# Need to explicitly set the source files to add_library()
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.11.0")
|
||||
file(GLOB E57Format_SOURCES src/[^.]*.cpp)
|
||||
set( REVISION_ID "${PROJECT_NAME}-${PROJECT_VERSION}-${${PROJECT_NAME}_BUILD_TAG}" )
|
||||
if ( GIT_LATEST_TAG )
|
||||
set( REVISION_ID "${REVISION_ID} (git ${GIT_LATEST_TAG})" )
|
||||
endif()
|
||||
message( STATUS "[${PROJECT_NAME}] Revision ID: ${REVISION_ID}" )
|
||||
|
||||
# Target
|
||||
if ( E57_BUILD_SHARED )
|
||||
message( STATUS "[E57] Building shared library" )
|
||||
message( STATUS "[${PROJECT_NAME}] Building shared library" )
|
||||
add_library( E57Format SHARED ${E57Format_SOURCES})
|
||||
else()
|
||||
message( STATUS "[E57] Building static library" )
|
||||
message( STATUS "[${PROJECT_NAME}] Building static library" )
|
||||
add_library( E57Format STATIC ${E57Format_SOURCES})
|
||||
endif()
|
||||
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT ipo_ok OUTPUT ipo_msg)
|
||||
if(NOT ipo_ok)
|
||||
set(E57_RELEASE_LTO Off)
|
||||
endif()
|
||||
|
||||
include( E57ExportHeader )
|
||||
include( GitUpdate )
|
||||
|
||||
# Main sources and includes
|
||||
add_subdirectory( extern/CRCpp )
|
||||
add_subdirectory( include )
|
||||
add_subdirectory( src )
|
||||
|
||||
include( ClangFormat )
|
||||
|
||||
# Target properties
|
||||
set_target_properties( E57Format
|
||||
PROPERTIES
|
||||
CXX_STANDARD 11
|
||||
CXX_STANDARD_REQUIRED YES
|
||||
CXX_EXTENSIONS NO
|
||||
DEBUG_POSTFIX "-d"
|
||||
CXX_EXTENSIONS NO
|
||||
EXPORT_COMPILE_COMMANDS ON
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
INTERPROCEDURAL_OPTIMIZATION ${E57_RELEASE_LTO}
|
||||
INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF
|
||||
)
|
||||
|
||||
if ( NOT DEFINED CMAKE_DEBUG_POSTFIX )
|
||||
set_target_properties( E57Format
|
||||
PROPERTIES
|
||||
DEBUG_POSTFIX "-d"
|
||||
)
|
||||
endif()
|
||||
|
||||
if ( E57_BUILD_SHARED )
|
||||
set_target_properties( E57Format
|
||||
PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||
)
|
||||
endif()
|
||||
|
||||
target_compile_features( ${PROJECT_NAME}
|
||||
PRIVATE
|
||||
cxx_std_14
|
||||
)
|
||||
|
||||
# Warnings
|
||||
include( CompilerWarnings )
|
||||
|
||||
# Check our validation level
|
||||
string( STRIP "${E57_VALIDATION_LEVEL}" E57_VALIDATION_LEVEL )
|
||||
if ( NOT E57_VALIDATION_LEVEL MATCHES "^[0-2]$" )
|
||||
message( FATAL_ERROR "[${PROJECT_NAME}] E57_VALIDATION_LEVEL should be 0-2: '${E57_VALIDATION_LEVEL}'" )
|
||||
else()
|
||||
message( STATUS "[${PROJECT_NAME}] Setting validation level to ${E57_VALIDATION_LEVEL}" )
|
||||
endif ()
|
||||
|
||||
# Target definitions
|
||||
target_compile_definitions( E57Format
|
||||
PRIVATE
|
||||
CRCPP_USE_CPP11
|
||||
CRCPP_BRANCHLESS
|
||||
REVISION_ID="${revision_id}"
|
||||
REVISION_ID="${REVISION_ID}"
|
||||
E57_VALIDATION_LEVEL=${E57_VALIDATION_LEVEL}
|
||||
$<$<BOOL:${E57_ENABLE_DIAGNOSTIC_OUTPUT}>:E57_ENABLE_DIAGNOSTIC_OUTPUT>
|
||||
$<$<BOOL:${E57_VERBOSE}>:E57_VERBOSE>
|
||||
$<$<BOOL:${E57_WRITE_CRAZY_PACKET_MODE}>:E57_WRITE_CRAZY_PACKET_MODE>
|
||||
)
|
||||
|
||||
if ( E57_DEBUG )
|
||||
target_compile_definitions( E57Format PRIVATE E57_DEBUG )
|
||||
endif()
|
||||
|
||||
if ( E57_MAX_DEBUG )
|
||||
target_compile_definitions( E57Format PRIVATE E57_MAX_DEBUG )
|
||||
endif()
|
||||
|
||||
if ( E57_VERBOSE )
|
||||
target_compile_definitions( E57Format PRIVATE E57_VERBOSE )
|
||||
endif()
|
||||
|
||||
if ( E57_MAX_VERBOSE )
|
||||
target_compile_definitions( E57Format PRIVATE E57_MAX_VERBOSE )
|
||||
endif()
|
||||
|
||||
if ( E57_WRITE_CRAZY_PACKET_MODE )
|
||||
target_compile_definitions( E57Format PRIVATE E57_WRITE_CRAZY_PACKET_MODE )
|
||||
endif()
|
||||
|
||||
if ( WIN32 )
|
||||
option( USING_STATIC_XERCES "Turn on if you are linking with Xerces as a static lib" OFF )
|
||||
if ( USING_STATIC_XERCES )
|
||||
target_compile_definitions( E57Format
|
||||
PUBLIC
|
||||
XERCES_STATIC_LIBRARY
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Suppress all warnings for this specific 3rd-party target
|
||||
target_compile_options(E57Format PRIVATE
|
||||
$<$<CXX_COMPILER_ID:GNU,Clang>:-w>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/w>
|
||||
)
|
||||
# sanitizers
|
||||
include( Sanitizers )
|
||||
|
||||
# Target Libraries
|
||||
target_link_libraries( E57Format PRIVATE XercesC::XercesC )
|
||||
@@ -186,21 +209,57 @@ install(
|
||||
E57Format
|
||||
EXPORT
|
||||
E57Format-export
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
||||
# CMake package files
|
||||
#install(
|
||||
# EXPORT
|
||||
# E57Format-export
|
||||
# DESTINATION lib/cmake/E57Format
|
||||
#)
|
||||
# ccache
|
||||
# Turns on ccache if found
|
||||
include( ccache )
|
||||
|
||||
#install(
|
||||
# FILES
|
||||
# ${CMAKE_CURRENT_SOURCE_DIR}/cmake/e57format-config.cmake
|
||||
# DESTINATION
|
||||
# lib/cmake/E57Format
|
||||
#)
|
||||
# Formatting
|
||||
include( ClangFormat )
|
||||
|
||||
# Testing
|
||||
option( E57_BUILD_TEST
|
||||
"Build tests"
|
||||
${E57_BUILDING_SELF}
|
||||
)
|
||||
|
||||
if ( E57_BUILD_TEST )
|
||||
message( STATUS "[${PROJECT_NAME}] Testing enabled" )
|
||||
|
||||
enable_testing()
|
||||
|
||||
add_subdirectory( test )
|
||||
endif()
|
||||
|
||||
# CMake package files
|
||||
include( GNUInstallDirs )
|
||||
set( E57_INSTALL_CMAKEDIR
|
||||
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
CACHE STRING
|
||||
"Install path for ${PROJECT_NAME} CMake files"
|
||||
)
|
||||
|
||||
message( STATUS "[${PROJECT_NAME}] CMake files install to ${CMAKE_INSTALL_PREFIX}/${E57_INSTALL_CMAKEDIR}" )
|
||||
|
||||
install(
|
||||
EXPORT
|
||||
E57Format-export
|
||||
DESTINATION
|
||||
"${E57_INSTALL_CMAKEDIR}"
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file (
|
||||
e57format-config-version.cmake
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/e57format-config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/e57format-config-version.cmake
|
||||
DESTINATION
|
||||
"${E57_INSTALL_CMAKEDIR}"
|
||||
)
|
||||
|
||||
+24
-8
@@ -1,21 +1,37 @@
|
||||
# How To Contribute
|
||||
|
||||
## Code Changes
|
||||
These are some of the things you can do to contribute to the project:
|
||||
|
||||
## 💰 Financial
|
||||
|
||||
Given that I'm an independent developer without funding, financial support is appreciated. If you would like to support the project financially (especially if you sell a product which uses this library), you can use the [sponsors page](https://github.com/sponsors/asmaloney) for one-off or recurring support, or we can arrange <a href="mailto:asmaloney@gmail.com?subject=libE57Format B2B Sponsorship">B2B invoicing</a> of some kind. Thank you!
|
||||
|
||||
## ✍ Write About The Project
|
||||
|
||||
If you find the project useful, spread the word! Articles, mastodon posts, tweets, blog posts, instagram photos - whatever you're into. Please include a referral back to the repository page: https://github.com/asmaloney/libE57Format
|
||||
|
||||
## ⭐️ Add a Star
|
||||
|
||||
If you found this project useful, please consider starring it! It helps me gauge how useful this project is.
|
||||
|
||||
## ☝ Raise Issues
|
||||
|
||||
If you run into something which doesn't work as expected, raising [an issue](https://github.com/asmaloney/libE57Format/issues) with all the relevant information to reproduce it would be helpful.
|
||||
|
||||
## 🐞 Bug Fixes & 🧪 New Things
|
||||
|
||||
I am happy to review any [pull requests](https://github.com/asmaloney/libE57Format/pulls). Please keep them as short as possible. Each pull request should be atomic and only address one issue. This helps with the review process.
|
||||
|
||||
Note that I will not accept everything, but I welcome discussion. If you are proposing a big change, please raise it as [an issue](https://github.com/asmaloney/libE57Format/issues) first for discussion.
|
||||
|
||||
### Formatting
|
||||
|
||||
This project uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format the code. There is a cmake target (_format_) - which runs _clang-format_ on the source files. After changes have been made, and before you submit your pull request, please run the following:
|
||||
This project uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format the code. There is a cmake target (_e57-clang-format_) - which runs _clang-format_ on the source files. After changes have been made, and before you submit your pull request, please run the following:
|
||||
|
||||
```sh
|
||||
cmake --build . --target format
|
||||
cmake --build . --target e57-clang-format
|
||||
```
|
||||
|
||||
## Documentation
|
||||
## 📖 Documentation
|
||||
|
||||
The [documentation](https://github.com/asmaloney/libE57Format) is a bit old and could use some lovin'. You can submit changes over in the [libE57Format-docs](https://github.com/asmaloney/libE57Format-docs) repository.
|
||||
|
||||
## Financial
|
||||
|
||||
If you would like to support the project financially, you can use the **Sponsor** button at the top of the [libE57Format](https://github.com/asmaloney/libE57Format) repository page.
|
||||
|
||||
Vendored
+131
-25
@@ -1,53 +1,159 @@
|
||||
# libE57Format
|
||||
|
||||
[](https://travis-ci.org/asmaloney/libE57Format)
|
||||
[](https://github.com/asmaloney/libE57Format/releases/latest) [](https://asmaloney.github.io/libE57Format-docs/) [](LICENSE) 
|
||||
|
||||
A library to provide read & write support for the E57 file format.
|
||||
|
||||
This is a fork of [E57RefImpl](https://sourceforge.net/projects/e57-3d-imgfmt/) v1.1.332. The original source is from [E57RefImpl 1.1.332](https://sourceforge.net/projects/e57-3d-imgfmt/files/E57Refimpl-src/) and then everything was stripped out except the main implementation for reading and writing E57.
|
||||
|
||||
This version also removes the dependency on [Boost](https://www.boost.org/) and requires C++11.
|
||||
|
||||
Many, many other changes were made prior to the first release of this fork. See the [CHANGELOG](CHANGELOG.md) and git history for details.
|
||||
libE57Format is a C++ library which provides read & write support for the ASTM-standard [E57 file format](https://www.astm.org/e2807-11r19e01.html) on Linux, macOS, and Windows. E57 files store 3D point cloud data (produced by 3D imaging systems such as laser scanners), attributes associated with 3D point data (color & intensity), and 2D images (photos taken using a 3D imaging system).
|
||||
|
||||
## Documentation
|
||||
|
||||
The doxygen-generated documentation may be [found here](https://asmaloney.github.io/libE57Format-docs/). These docs are generated and saved in the [libE57Format-docs](https://github.com/asmaloney/libE57Format-docs) repo.
|
||||
|
||||
## Contributing
|
||||
## Commercial Use
|
||||
|
||||
Please see [CONTRIBUTING](CONTRIBUTING.md).
|
||||
If you are using this library in commercial software, please [contribute to the project](/CONTRIBUTING.md).
|
||||
|
||||
## Why Fork?
|
||||
Of course the open source license allows you to just take and not give anything back. It is perfectly Legal, but it is not Right and it's not good for the project.
|
||||
|
||||
The E57RefImpl code hasn't been touched in years and I wanted to make changes to compile this library with macOS. Forking it gives me a bit more freedom to update the code and make changes as required.
|
||||
Over the many years I've worked on this library, I have received precisely _zero_ contributions (PRs, documentation updates, improved testing, financial support) from the many million/billion-dollar companies who use it in their software.
|
||||
|
||||
I changed the name of the project so that it is not confused with the **E57RefImpl** project.
|
||||
The more companies that leech on Open Source instead of nurturing it, the less healthy & viable the ecosystem is.
|
||||
|
||||
I have also changed the main include file's name from `E57Foundation.h` to `E57Format.h` to make sure there is no inclusion confusion.
|
||||
## Requirements
|
||||
|
||||
Versions of **libE57Format** started at 2.0.
|
||||
- a [C++14](https://en.cppreference.com/w/cpp/14) compatible compiler
|
||||
- [CMake](https://cmake.org/) >= 3.15
|
||||
- [clang-format](https://clang.llvm.org/docs/ClangFormat.html) for code formatting
|
||||
- (_optional_) [ccache](https://ccache.dev/) to speed up rebuilds
|
||||
|
||||
## Dependencies
|
||||
|
||||
- [Xerces-C++](https://xerces.apache.org/xerces-c/) (for parsing XML)
|
||||
|
||||
### Installing Dependencies On Linux (Ubuntu)
|
||||
|
||||
```sh
|
||||
$ sudo apt install libxerces-c-dev clang-format
|
||||
```
|
||||
|
||||
### Installing Dependencies On macOS (homebrew)
|
||||
|
||||
```sh
|
||||
$ brew install ccache clang-format xerces-c
|
||||
```
|
||||
|
||||
## Build, Install, & Test
|
||||
|
||||
Here's how you build & install a release version with the defaults:
|
||||
|
||||
```
|
||||
$ cmake -B E57-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=E57-install libE57Format
|
||||
$ cmake --build E57-build --parallel
|
||||
$ cmake --install E57-build
|
||||
```
|
||||
|
||||
If CMake can't find the xerces-c library, you can set [CMAKE_PREFIX_PATH](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html) to point at it.
|
||||
|
||||
```
|
||||
$ cmake -B E57-build \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=E57-install \
|
||||
-DCMAKE_PREFIX_PATH=/path/to/xerces-c \
|
||||
libE57Format
|
||||
```
|
||||
|
||||
Once the library is built, you can run the tests like this:
|
||||
|
||||
```
|
||||
$ cd E57-build
|
||||
$ ./test/testE57
|
||||
[==========] Running 36 tests from 8 test suites.
|
||||
[----------] Global test environment set-up.
|
||||
[----------] 1 test from TestData
|
||||
[ RUN ] TestData.RepoExists
|
||||
...
|
||||
```
|
||||
|
||||
See [test/README](test/README.md) for details about testing and the test data.
|
||||
|
||||
## 🍴 Fork (2018)
|
||||
|
||||
This is a fork of [E57RefImpl](https://sourceforge.net/projects/e57-3d-imgfmt/). The original source is from [E57RefImpl 1.1.332](https://sourceforge.net/projects/e57-3d-imgfmt/files/E57Refimpl-src/).
|
||||
|
||||
The original code had not been touched in several years and I wanted to make changes to compile it on macOS. Forking it gave me more freedom to update the code and make changes as required. Everything was stripped out except the main implementation for reading & writing E57 files.
|
||||
|
||||
- I changed the name of the project so that it is not confused with the **E57RefImpl** project.
|
||||
- I changed the main include file's name from `E57Foundation.h` to `E57Format.h` to make sure there is no inclusion confusion.
|
||||
- Versions of **libE57Format** started at 2.0.
|
||||
- I fixed it to compile and run on macOS.
|
||||
- It no longer depends on [Boost](https://www.boost.org/).
|
||||
- It now requires [C++14](https://en.cppreference.com/w/cpp/14). (Version 2.x required [C++11](https://en.cppreference.com/w/cpp/11).)
|
||||
|
||||
Many, many other changes were made prior to the first release of this fork, and it has diverged significantly since. See the [CHANGELOG](CHANGELOG.md) and git history for details.
|
||||
|
||||
### E57Simple API
|
||||
|
||||
Since the original fork, [Jiri Hörner](https://github.com/ptc-jhoerner) has added the E57Simple API from the old reference implementation and updated it.
|
||||
[Jiri Hörner](https://github.com/ptc-jhoerner) added the E57Simple API from the old reference implementation and updated it.
|
||||
|
||||
### Tools
|
||||
This _Simple API_ has evolved since this original port to fix some problems and to make it more foolproof & easier to use. Please see the [CHANGELOG](CHANGELOG.md) for version 3.
|
||||
|
||||
[Ryan Baumann](https://github.com/ryanfb) has updated the `e57unpack` and `e57validate` tools to work with **libE57Format**. You can find them in the [e57tools](https://github.com/ryanfb/e57tools) repo.
|
||||
## Projects Using libE57Format
|
||||
|
||||
- [AliceVision](https://github.com/alicevision/AliceVision)
|
||||
- [CloudCompare](https://github.com/CloudCompare/CloudCompare)
|
||||
- [MeshLab](https://github.com/cnr-isti-vclab/meshlab)
|
||||
- [pye57](https://github.com/davidcaron/pye57)
|
||||
|
||||
These projects use hard forks of libE57Format:
|
||||
|
||||
- [FreeCAD](https://github.com/FreeCAD/FreeCAD)
|
||||
- [PDAL](https://github.com/PDAL/PDAL)
|
||||
|
||||
There are also many commercial products using libE57Format. If any of them would like to sponsor the project and be listed here, please <a href="mailto:asmaloney@gmail.com?subject=libE57Format Sponsorship">contact Andy</a>.
|
||||
|
||||
## How To Contribute
|
||||
|
||||
These are some of the things you can do to contribute to the project:
|
||||
|
||||
### 💰 Financial
|
||||
|
||||
Given that I'm an independent developer without funding, financial support is appreciated. If you would like to support the project financially (especially if you sell a product which uses this library), you can use the [sponsors page](https://github.com/sponsors/asmaloney) for one-off or recurring support, or we can arrange <a href="mailto:asmaloney@gmail.com?subject=libE57Format B2B Sponsorship">B2B invoicing</a> of some kind. Thank you!
|
||||
|
||||
### ✍ Write About The Project
|
||||
|
||||
If you find the project useful, spread the word! Articles, mastodon posts, tweets, blog posts, instagram photos - whatever you're into. Please include a referral back to the repository page: https://github.com/asmaloney/libE57Format
|
||||
|
||||
### ⭐️ Add a Star
|
||||
|
||||
If you found this project useful, please consider starring it! It helps me gauge how useful this project is.
|
||||
|
||||
### ☝ Raise Issues
|
||||
|
||||
If you run into something which doesn't work as expected, raising [an issue](https://github.com/asmaloney/libE57Format/issues) with all the relevant information to reproduce it would be helpful.
|
||||
|
||||
### 🐞 Bug Fixes & 🧪 New Things
|
||||
|
||||
I am happy to review any [pull requests](https://github.com/asmaloney/libE57Format/pulls). Please keep them as short as possible. Each pull request should be atomic and only address one issue. This helps with the review process.
|
||||
|
||||
Note that I will not accept everything, but I welcome discussion. If you are proposing a big change, please raise it as [an issue](https://github.com/asmaloney/libE57Format/issues) first for discussion.
|
||||
|
||||
#### Formatting
|
||||
|
||||
This project uses [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format the code. There is a cmake target (_e57-clang-format_) - which runs _clang-format_ on the source files. After changes have been made, and before you submit your pull request, please run the following:
|
||||
|
||||
```sh
|
||||
cmake --build . --target e57-clang-format
|
||||
```
|
||||
|
||||
### 📖 Documentation
|
||||
|
||||
The [documentation](https://github.com/asmaloney/libE57Format) is a bit old and could use some lovin'. You can submit changes over in the [libE57Format-docs](https://github.com/asmaloney/libE57Format-docs) repository.
|
||||
|
||||
## License
|
||||
|
||||
This project as a whole is licensed under the [**BSL-1.0**](https://opensource.org/licenses/BSL-1.0) license - see the [LICENSE](LICENSE.md) file for details.
|
||||
This project is licensed under the [**BSL-1.0** license](https://opensource.org/licenses/BSL-1.0) - see the [LICENSE](LICENSE.md) file for details.
|
||||
|
||||
Individual source files may contain the following tag instead of the full license text:
|
||||
|
||||
SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
Some CMake files are licensed under the **MIT** license - see the [LICENSE-MIT](LICENSE-MIT.txt) file for details.
|
||||
|
||||
These files contain the following tag instead of the full license text:
|
||||
|
||||
SPDX-License-Identifier: MIT
|
||||
|
||||
Using SPDX enables machine processing of license information based on the [SPDX License Identifiers](https://spdx.org/ids) and makes it easier for developers to see at a glance which license they are dealing with.
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Copyright 2020 Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
find_program( E57_CLANG_FORMAT_PROGRAM NAMES clang-format )
|
||||
|
||||
if ( E57_CLANG_FORMAT_PROGRAM )
|
||||
message( STATUS "[${PROJECT_NAME}] Using clang-format: ${E57_CLANG_FORMAT_PROGRAM}" )
|
||||
|
||||
get_target_property( e57_sources ${PROJECT_NAME} SOURCES )
|
||||
|
||||
# Remove some files from the list
|
||||
list( FILTER e57_sources EXCLUDE REGEX ".*/E57Export.h" )
|
||||
list( FILTER e57_sources EXCLUDE REGEX ".*/extern/.*" )
|
||||
|
||||
# Get list of test files. We cannot use get_target_property here
|
||||
# since we will not have a target if E57_BUILD_TEST is off.
|
||||
file( GLOB e57_test_sources
|
||||
LIST_DIRECTORIES false
|
||||
CONFIGURE_DEPENDS
|
||||
${PROJECT_SOURCE_DIR}/test/include/*.h
|
||||
${PROJECT_SOURCE_DIR}/test/src/*.cpp
|
||||
)
|
||||
|
||||
list( APPEND e57_sources ${e57_test_sources} )
|
||||
|
||||
add_custom_target( e57-clang-format
|
||||
COMMAND ${E57_CLANG_FORMAT_PROGRAM} --style=file -i ${e57_sources}
|
||||
COMMENT "Running clang-format..."
|
||||
COMMAND_EXPAND_LISTS
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,112 @@
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Copyright 2022 Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
string( TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE )
|
||||
|
||||
if ( NOT MSVC )
|
||||
option( ${PROJECT_NAME_UPPERCASE}_WARN_EVERYTHING "Turn on all warnings (not recommended - used for lib development)" OFF )
|
||||
endif()
|
||||
|
||||
option( ${PROJECT_NAME_UPPERCASE}_WARNING_AS_ERROR "Treat warnings as errors" OFF )
|
||||
|
||||
# Set some helper variables for readability
|
||||
set( compiler_is_clang "$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>>" )
|
||||
set( compiler_is_gnu "$<CXX_COMPILER_ID:GNU>" )
|
||||
set( compiler_is_msvc "$<CXX_COMPILER_ID:MSVC>" )
|
||||
|
||||
target_compile_options( ${PROJECT_NAME}
|
||||
PRIVATE
|
||||
# MSVC only
|
||||
$<${compiler_is_msvc}:
|
||||
/W4
|
||||
/w14263 # 'function': member function does not override any base class virtual member function
|
||||
/w14296 # 'operator': expression is always 'boolean_value'
|
||||
/w14311 # 'variable': pointer truncation from 'type1' to 'type2'
|
||||
/w14545 # expression before comma evaluates to a function which is missing an argument list
|
||||
/w14546 # function call before comma missing argument list
|
||||
/w14547 # 'operator': operator before comma has no effect; expected operator with side-effect
|
||||
/w14549 # 'operator': operator before comma has no effect; did you intend 'operator'?
|
||||
/w14619 # pragma warning: there is no warning number 'number'
|
||||
/w14640 # thread un-safe static member initialization
|
||||
/w14905 # wide string literal cast to 'LPSTR'
|
||||
/w14906 # string literal cast to 'LPWSTR'
|
||||
|
||||
/wd4251 # 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
|
||||
>
|
||||
# Clang and GNU common options
|
||||
$<$<OR:${compiler_is_clang},${compiler_is_gnu}>:
|
||||
-Wall
|
||||
-Wcast-align
|
||||
-Wextra
|
||||
-Wformat=2
|
||||
-Wnon-virtual-dtor
|
||||
-Wnull-dereference
|
||||
-Woverloaded-virtual
|
||||
-Wpedantic
|
||||
-Wshadow
|
||||
-Wunused
|
||||
>
|
||||
# Clang only
|
||||
$<${compiler_is_clang}:
|
||||
-Wdocumentation
|
||||
-Wno-documentation-deprecated-sync # because enumerator [[deprecated]] attribute is C++17
|
||||
>
|
||||
# GNU only
|
||||
$<${compiler_is_gnu}:
|
||||
-Wduplicated-branches
|
||||
-Wduplicated-cond
|
||||
-Wlogical-op
|
||||
>
|
||||
)
|
||||
|
||||
# Turn on (almost) all warnings on Clang, Apple Clang, and GNU.
|
||||
# Useful for internal development, but too noisy for general development.
|
||||
function( set_warn_everything )
|
||||
message( STATUS "[${PROJECT_NAME}] Turning on (almost) all warnings")
|
||||
|
||||
target_compile_options( ${PROJECT_NAME}
|
||||
PRIVATE
|
||||
# Clang and GNU
|
||||
$<$<OR:${compiler_is_clang},${compiler_is_gnu}>:
|
||||
-Weverything
|
||||
-Wno-c++98-compat
|
||||
-Wno-c++98-compat-pedantic
|
||||
-Wno-padded
|
||||
>
|
||||
# Clang only
|
||||
$<${compiler_is_clang}:
|
||||
-Wno-documentation-deprecated-sync # because enumerator [[deprecated]] attribute is C++17
|
||||
>
|
||||
)
|
||||
endfunction()
|
||||
|
||||
if ( NOT MSVC AND ${PROJECT_NAME_UPPERCASE}_WARN_EVERYTHING )
|
||||
set_warn_everything()
|
||||
endif()
|
||||
|
||||
# Treat warnings as errors
|
||||
function( set_warning_as_error )
|
||||
message( STATUS "[${PROJECT_NAME}] Treating warnings as errors")
|
||||
|
||||
if ( CMAKE_VERSION VERSION_GREATER_EQUAL "3.24" )
|
||||
set_target_properties( ${PROJECT_NAME}
|
||||
PROPERTIES
|
||||
COMPILE_WARNING_AS_ERROR ON
|
||||
)
|
||||
else()
|
||||
# This will do nothing on compilers other than MSVC, Clang, Apple Clang, and GNU compilers.
|
||||
target_compile_options( ${PROJECT_NAME}
|
||||
PRIVATE
|
||||
$<${compiler_is_msvc}:
|
||||
/WX
|
||||
>
|
||||
$<$<OR:${compiler_is_clang},${compiler_is_gnu}>:
|
||||
-Werror
|
||||
>
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if ( ${PROJECT_NAME_UPPERCASE}_WARNING_AS_ERROR )
|
||||
set_warning_as_error()
|
||||
endif()
|
||||
+4
-2
@@ -1,11 +1,13 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Copyright 2020 Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
# Generate the export header file for E57Format
|
||||
|
||||
include( GenerateExportHeader )
|
||||
|
||||
set( comment "// NOTE: This is a generated file. Any changes will be overwritten." )
|
||||
set( comment "\r
|
||||
// NOTE: This is a generated file. Any changes will be overwritten."
|
||||
)
|
||||
|
||||
generate_export_header( E57Format
|
||||
EXPORT_FILE_NAME E57Export.h
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
# ---------------------------------------------------------------------------- #
|
||||
#
|
||||
# Copyright (c) 2020 C++ Modern Framework
|
||||
#
|
||||
# https://github.com/cppmf/GitInfo.cmake
|
||||
#
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
# Modified June 2024 - Andy Maloney <asmaloney@gmail.com>
|
||||
# - remove some vars we aren't using
|
||||
# - fix spelling/grammar
|
||||
|
||||
# ---------------------------------------------------------------------------- #
|
||||
#
|
||||
# Following variables will be set when calling GitInfo
|
||||
#
|
||||
# GIT_DIR: path to the project .git directory
|
||||
# GIT_IS_DIRTY: whether or not the working tree is dirty
|
||||
# GIT_HEAD_BRANCH : name of the branch associated to HEAD
|
||||
# GIT_REVISION_HASH: current HEAD sha hash
|
||||
# GIT_REVISION: short version of GIT_REVISION_HASH
|
||||
# GIT_REVISION_NAME: name associated to GIT_REVISION_HASH
|
||||
# GIT_REMOTE_ORIGIN_URL : origin remote url
|
||||
# GIT_LATEST_TAG_LONG : most recent tag of the current branch
|
||||
# GIT_LATEST_TAG : most recent tagname of the current branch
|
||||
#
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
# This is the main function to call in project CMakeLists.txt
|
||||
# source should point to the root project directory
|
||||
function(GitInfo source)
|
||||
|
||||
# Check is source is a valid path
|
||||
if(NOT EXISTS ${source})
|
||||
message(FATAL_ERROR "'${source}' is not a valid path")
|
||||
endif()
|
||||
|
||||
# Define the possible location of the .git directory
|
||||
set(GIT_DIR "${source}/.git")
|
||||
|
||||
# Check if .git folder exist
|
||||
if(EXISTS ${GIT_DIR})
|
||||
|
||||
#
|
||||
set(GIT_DIR "${GIT_DIR}" CACHE PATH "Project .git directory")
|
||||
|
||||
# Check if git is installed
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
if(NOT GIT_FOUND)
|
||||
message(AUTHOR_WARNING "Git not found, cannot get git information")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# name of the branch associated to HEAD
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||
WORKING_DIRECTORY ${source}
|
||||
OUTPUT_VARIABLE GIT_HEAD_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(GIT_HEAD_BRANCH "${GIT_HEAD_BRANCH}" CACHE INTERNAL "name of the branch associated to HEAD")
|
||||
|
||||
# git revision full hash
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} show -s "--format=%H" HEAD
|
||||
WORKING_DIRECTORY ${source}
|
||||
OUTPUT_VARIABLE GIT_REVISION_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(GIT_REVISION_HASH "${GIT_REVISION_HASH}" CACHE INTERNAL "git revision full hash")
|
||||
|
||||
# short version of git revision
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} show -s "--format=%h" HEAD
|
||||
WORKING_DIRECTORY ${source}
|
||||
OUTPUT_VARIABLE GIT_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(GIT_REVISION "${GIT_REVISION}" CACHE INTERNAL "short version of git revision")
|
||||
|
||||
# short version of git revision name
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} show -s "--format=%s" HEAD
|
||||
WORKING_DIRECTORY ${source}
|
||||
OUTPUT_VARIABLE GIT_REVISION_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(GIT_REVISION_NAME "${GIT_REVISION_NAME}" CACHE INTERNAL "short version of git revision name")
|
||||
|
||||
# origin remote url
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} config --get remote.origin.url
|
||||
WORKING_DIRECTORY ${source}
|
||||
OUTPUT_VARIABLE GIT_REMOTE_ORIGIN_URL OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(GIT_REMOTE_ORIGIN_URL "${GIT_REMOTE_ORIGIN_URL}" CACHE INTERNAL "git origin remote url")
|
||||
|
||||
# most recent tag of the current branch
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0 HEAD
|
||||
WORKING_DIRECTORY ${source}
|
||||
OUTPUT_VARIABLE GIT_LATEST_TAG_LONG OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(GIT_LATEST_TAG_LONG "${GIT_LATEST_TAG_LONG}" CACHE INTERNAL "git most recent tag of the current branch")
|
||||
|
||||
# most recent tagname of the current branch
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags HEAD
|
||||
WORKING_DIRECTORY ${source}
|
||||
OUTPUT_VARIABLE GIT_LATEST_TAG OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(GIT_LATEST_TAG "${GIT_LATEST_TAG}" CACHE INTERNAL "git most recent tagname of the current branch")
|
||||
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
|
||||
# Report git information
|
||||
function(GitInfoReport)
|
||||
message(STATUS "")
|
||||
message(STATUS "----------------------------------------------------")
|
||||
message(STATUS " GitInfo.cmake")
|
||||
message(STATUS "")
|
||||
message(STATUS "GIT_DIR : ${GIT_DIR}")
|
||||
message(STATUS "")
|
||||
message(STATUS "GIT_HEAD_BRANCH : ${GIT_HEAD_BRANCH}")
|
||||
message(STATUS "GIT_REVISION : ${GIT_REVISION}")
|
||||
message(STATUS "GIT_REVISION_HASH : ${GIT_REVISION_HASH}")
|
||||
message(STATUS "GIT_REVISION_NAME : ${GIT_REVISION_NAME}")
|
||||
message(STATUS "")
|
||||
message(STATUS "GIT_REMOTE_ORIGIN_URL : ${GIT_REMOTE_ORIGIN_URL}")
|
||||
message(STATUS "GIT_LATEST_TAG_LONG : ${GIT_LATEST_TAG_LONG}")
|
||||
message(STATUS "GIT_LATEST_TAG : ${GIT_LATEST_TAG}")
|
||||
message(STATUS "")
|
||||
message(STATUS "----------------------------------------------------")
|
||||
message(STATUS "")
|
||||
endfunction()
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
find_package( Git QUIET )
|
||||
|
||||
if ( GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git" )
|
||||
# Update submodules as needed
|
||||
option( E57_GIT_SUBMODULE_UPDATE "Check submodules and update during build" ON )
|
||||
|
||||
if ( E57_GIT_SUBMODULE_UPDATE )
|
||||
message( STATUS "Submodule update using git (${GIT_EXECUTABLE})" )
|
||||
message( STATUS "Submodule update directory: ${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||
|
||||
execute_process( COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_SUBMOD_RESULT
|
||||
ERROR_VARIABLE GIT_SUBMOD_RESULT)
|
||||
|
||||
if ( GIT_SUBMOD_RESULT EQUAL "0" )
|
||||
message( STATUS "Submodule update complete" )
|
||||
else()
|
||||
message( FATAL_ERROR "Submodule update failed with ${GIT_SUBMOD_RESULT}, please checkout submodules" )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,19 +0,0 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright 2020 Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
find_program( E57_CLANG_FORMAT_EXE NAMES clang-format )
|
||||
|
||||
if ( E57_CLANG_FORMAT_EXE )
|
||||
get_target_property( e57_sources ${PROJECT_NAME} SOURCES )
|
||||
|
||||
# Remove some files from the list
|
||||
list( FILTER e57_sources EXCLUDE REGEX ".*/E57Export.h" )
|
||||
list( FILTER e57_sources EXCLUDE REGEX ".*/extern/.*" )
|
||||
|
||||
add_custom_target( format
|
||||
COMMAND clang-format --style=file -i ${e57_sources}
|
||||
COMMENT "Running clang-format..."
|
||||
COMMAND_EXPAND_LISTS
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
@@ -1,41 +0,0 @@
|
||||
# This file defines the variables
|
||||
# ${PROJECT_NAME}_BUILD_TAG
|
||||
|
||||
# calculate the tag
|
||||
set(T_ ${CMAKE_SYSTEM_PROCESSOR})
|
||||
if (CMAKE_CL_64)
|
||||
set(T_ ${T_}_64)
|
||||
endif (CMAKE_CL_64)
|
||||
string(TOLOWER ${CMAKE_SYSTEM_NAME} T1_)
|
||||
set(T_ ${T_}-${T1_})
|
||||
if (MSVC90)
|
||||
set(T1_ "-vc90")
|
||||
elseif (MSVC10)
|
||||
set(T1_ "-vc100")
|
||||
elseif (MSVC80)
|
||||
set(T1_ "-vc80")
|
||||
elseif (MSVC71)
|
||||
set(T1_ "-vc711")
|
||||
elseif (MSVC70)
|
||||
set(T1_ "-vc7")
|
||||
elseif (MINGW)
|
||||
set(T1_ "-mgw")
|
||||
exec_program(${CMAKE_CXX_COMPILER}
|
||||
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE T2_
|
||||
)
|
||||
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" T2_ ${T2_})
|
||||
set(T1_ ${T1_}${T2_})
|
||||
elseif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(T1_ "-gcc")
|
||||
exec_program(${CMAKE_CXX_COMPILER}
|
||||
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE T2_
|
||||
)
|
||||
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" T2_ ${T2_})
|
||||
set(T1_ ${T1_}${T2_})
|
||||
else()
|
||||
set(T1_)
|
||||
endif()
|
||||
set(T_ ${T_}${T1_})
|
||||
set(${PROJECT_NAME}_BUILD_TAG ${T_})
|
||||
@@ -0,0 +1,93 @@
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Copyright 2023 Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
# Note: In theory address sanitization should work on MSVC, but I could not get it working.
|
||||
# If you know how to fix it, please submit a PR:
|
||||
# https://github.com/asmaloney/libE57Format/pulls
|
||||
|
||||
string( TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE )
|
||||
|
||||
set( compiler_is_clang "$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>>" )
|
||||
set( compiler_is_gnu "$<CXX_COMPILER_ID:GNU>" )
|
||||
set( compiler_is_msvc "$<CXX_COMPILER_ID:MSVC>" )
|
||||
set( compiler_is_not_msvc "$<NOT:${compiler_is_msvc}>" )
|
||||
|
||||
if ( NOT MSVC )
|
||||
option( ${PROJECT_NAME_UPPERCASE}_SANITIZE_ALL "Enable all sanitizers if available." OFF )
|
||||
option( ${PROJECT_NAME_UPPERCASE}_SANITIZE_ADDRESS "Enable address sanitizer (ASan) if available." OFF )
|
||||
option( ${PROJECT_NAME_UPPERCASE}_SANITIZE_UNDEFINED "Enable memory sanitizer (UBSan) if available." OFF )
|
||||
endif()
|
||||
|
||||
function( enable_address_sanitizer target )
|
||||
message( STATUS "[${target}] Enabling address sanitizer (ASan)" )
|
||||
|
||||
target_compile_options( ${target}
|
||||
PRIVATE
|
||||
$<${compiler_is_not_msvc}:
|
||||
-fno-omit-frame-pointer
|
||||
-fsanitize=address
|
||||
>
|
||||
|
||||
$<${compiler_is_msvc}:
|
||||
/fsanitize=address
|
||||
/INCREMENTAL:NO
|
||||
/Zi
|
||||
>
|
||||
)
|
||||
target_link_options( ${target}
|
||||
PUBLIC
|
||||
$<${compiler_is_not_msvc}:
|
||||
-fno-omit-frame-pointer
|
||||
-fsanitize=address
|
||||
>
|
||||
|
||||
$<${compiler_is_msvc}:
|
||||
/DEBUG
|
||||
/INCREMENTAL:NO
|
||||
>
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function( enable_undefined_sanitizer target )
|
||||
if ( MSVC )
|
||||
message( WARNING "[${target}] Undefined behaviour sanitizer (UBSan) not available for MSVC" )
|
||||
return()
|
||||
endif()
|
||||
|
||||
message( STATUS "[${target}] Enabling undefined behaviour sanitizer (UBSan)" )
|
||||
|
||||
target_compile_options( ${target}
|
||||
PRIVATE
|
||||
-fsanitize=undefined
|
||||
)
|
||||
target_link_options( ${target}
|
||||
PUBLIC
|
||||
-fsanitize=undefined
|
||||
)
|
||||
endfunction()
|
||||
|
||||
function( enable_all_sanitizers target )
|
||||
if ( MSVC )
|
||||
return()
|
||||
endif()
|
||||
|
||||
unset( ${PROJECT_NAME_UPPERCASE}_SANITIZE_ADDRESS CACHE )
|
||||
unset( ${PROJECT_NAME_UPPERCASE}_SANITIZE_UNDEFINED CACHE )
|
||||
|
||||
enable_address_sanitizer( ${target} )
|
||||
enable_undefined_sanitizer( ${target} )
|
||||
endfunction()
|
||||
|
||||
if ( NOT MSVC )
|
||||
if ( ${PROJECT_NAME_UPPERCASE}_SANITIZE_ALL )
|
||||
enable_all_sanitizers( ${PROJECT_NAME} )
|
||||
else()
|
||||
if ( ${PROJECT_NAME_UPPERCASE}_SANITIZE_ADDRESS )
|
||||
enable_address_sanitizer( ${PROJECT_NAME} )
|
||||
endif()
|
||||
|
||||
if ( ${PROJECT_NAME_UPPERCASE}_SANITIZE_UNDEFINED )
|
||||
enable_undefined_sanitizer( ${PROJECT_NAME} )
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
# This file defines the variables
|
||||
# ${PROJECT_NAME}_BUILD_TAG
|
||||
|
||||
set( T_ ${CMAKE_SYSTEM_PROCESSOR} )
|
||||
|
||||
string( TOLOWER ${CMAKE_SYSTEM_NAME} T1_ )
|
||||
|
||||
function( add_compiler_version )
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||
OUTPUT_VARIABLE T2_
|
||||
)
|
||||
string( REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" T2_ ${T2_} )
|
||||
string( STRIP ${T2_} T2_ )
|
||||
set( T1_ ${T1_}${T2_} PARENT_SCOPE )
|
||||
endfunction()
|
||||
|
||||
# default to just the CMake compiler ID
|
||||
set( T1_ ${CMAKE_CXX_COMPILER_ID} )
|
||||
|
||||
# special cases to add versions and other info
|
||||
if ( MSVC )
|
||||
if ( CMAKE_CL_64 )
|
||||
set( T_ ${T_}_64 )
|
||||
endif()
|
||||
|
||||
set( T1_ "vc${MSVC_VERSION}" )
|
||||
elseif ( MINGW )
|
||||
set( T1_ "MinGW" )
|
||||
add_compiler_version()
|
||||
elseif ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
|
||||
set( T1_ "gcc" )
|
||||
add_compiler_version()
|
||||
elseif ( CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compiler_version()
|
||||
endif()
|
||||
|
||||
set( T_ ${T_}-${T1_} )
|
||||
set( ${PROJECT_NAME}_BUILD_TAG ${T_} )
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Copyright 2022 Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
# See: https://crascit.com/2016/04/09/using-ccache-with-cmake/
|
||||
find_program( CCACHE_PROGRAM ccache )
|
||||
|
||||
if ( CCACHE_PROGRAM )
|
||||
message( STATUS "[${PROJECT_NAME}] Using ccache: ${CCACHE_PROGRAM}" )
|
||||
|
||||
set_target_properties( ${PROJECT_NAME}
|
||||
PROPERTIES
|
||||
CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}"
|
||||
C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}"
|
||||
)
|
||||
endif()
|
||||
+9
-3
@@ -1,14 +1,20 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Copyright © Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
# CRCpp from here: https://github.com/d-bahr/CRCpp
|
||||
|
||||
target_compile_definitions( ${PROJECT_NAME}
|
||||
PRIVATE
|
||||
CRCPP_USE_CPP11
|
||||
CRCPP_BRANCHLESS
|
||||
)
|
||||
|
||||
target_sources( ${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc/CRC.h
|
||||
inc/CRC.h
|
||||
)
|
||||
|
||||
target_include_directories( ${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc
|
||||
inc
|
||||
)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
CRC++
|
||||
Copyright (c) 2016, Daniel Bahr
|
||||
Copyright (c) 2022, Daniel Bahr
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
+68
-1
@@ -82,7 +82,24 @@ int main(int argc, char ** argv)
|
||||
|
||||
This will return the same CRC as the first example.
|
||||
|
||||
Both of the above examples compute a CRC bit-by-bit. However, CRC++ also supports lookup tables, as the following example demonstrates:
|
||||
If you need to compute a CRC on an input that is not a multiple of `CHAR_BIT` (usually 8 bits), use the `CalculateBits()` function instead:
|
||||
|
||||
```cpp
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
const unsigned char data[] = { 0x98, 0x76, 0x54, 0x32, 0x10 };
|
||||
|
||||
// Second argument is the number of bits. The input data must
|
||||
// be a whole number of bytes. Pad any used bits with zeros.
|
||||
std::uint32_t crc = CRC::CalculateBits(data, 37, CRC::CRC_32());
|
||||
|
||||
std::cout << std::hex << crc;
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
The above examples compute a CRC bit-by-bit. However, CRC++ also supports lookup tables, as the following example demonstrates:
|
||||
|
||||
```cpp
|
||||
int main(int argc, char ** argv)
|
||||
@@ -149,6 +166,56 @@ Define to enables C++11 features (move semantics, constexpr, static_assert, etc.
|
||||
* `#define CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS`
|
||||
Define to include definitions for little-used CRCs. Not defined by default.
|
||||
|
||||
### Build
|
||||
|
||||
CRC does not require a build for basic usage; simply include the header file in your project.
|
||||
|
||||
Unit tests and documentation can be built manually with the project files provided or automatically with CMake.
|
||||
|
||||
To build documentation manually:
|
||||
```bash
|
||||
cd doxygen
|
||||
doxygen Doxyfile.dox
|
||||
```
|
||||
|
||||
To build unit tests manually via Make:
|
||||
```bash
|
||||
# Build
|
||||
cd test/prj/gcc
|
||||
make [debug|release]
|
||||
# Run unit tests
|
||||
bin/unittest
|
||||
```
|
||||
|
||||
Project files and solutions for Visual Studio 2015, 2017 and 2022 are provided in `test/prj`. Simply open the solution file and run the project; no additional configuration should be necessary.
|
||||
|
||||
CMake can also be used to build the documentation and unit tests. An out-of-source build is recommended. In this example, we will do an out-of-source build in the `build` directory:
|
||||
```bash
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. [-DBUILD_DOC=ON]
|
||||
# Build and run unit tests
|
||||
make tests
|
||||
# Build documentation
|
||||
make doxygen
|
||||
# Install header file
|
||||
sudo make install
|
||||
```
|
||||
|
||||
Unit tests are built by default. Enable the `BUILD_DOC` CMake flag to also build documentation (requires [Doxygen](https://www.doxygen.nl/index.html)).
|
||||
|
||||
### Documentation
|
||||
|
||||
https://d-bahr.github.io/CRCpp/
|
||||
|
||||
### License
|
||||
|
||||
CRC++ is free to use and provided under a BSD license.
|
||||
|
||||
### References
|
||||
|
||||
Catalog of CRCs: https://reveng.sourceforge.io/crc-catalogue/
|
||||
|
||||
5G-NR Specification 3GPP TS 38.212: https://www.etsi.org/deliver/etsi_ts/138200_138299/138212/15.03.00_60/ts_138212v150300p.pdf
|
||||
|
||||
USB 2.0 Specification: https://www.usb.org/document-library/usb-20-specification
|
||||
|
||||
+471
-60
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
@file CRC.h
|
||||
@author Daniel Bahr
|
||||
@version 0.2.0.6
|
||||
@version 1.2.0.0
|
||||
@copyright
|
||||
@parblock
|
||||
CRC++
|
||||
Copyright (c) 2016, Daniel Bahr
|
||||
Copyright (c) 2022, Daniel Bahr
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -52,7 +52,7 @@
|
||||
multiplication in the bit-by-bit calculation instead of a small conditional. The branchless implementation
|
||||
may be faster on processor architectures which support single-instruction integer multiplication.
|
||||
#define CRCPP_USE_CPP11 - Define to enables C++11 features (move semantics, constexpr, static_assert, etc.).
|
||||
#define CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS - Define to include definitions for little-used CRCs.
|
||||
#define CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS - Define to include definitions for little-used CRCs.
|
||||
*/
|
||||
|
||||
#ifndef CRCPP_CRC_H_
|
||||
@@ -127,6 +127,12 @@
|
||||
# define crcpp_constexpr const
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
|
||||
/* Disable warning C4127: conditional expression is constant. */
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
#ifdef CRCPP_USE_NAMESPACE
|
||||
namespace CRCPP
|
||||
{
|
||||
@@ -202,6 +208,18 @@ public:
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
static CRCType Calculate(const void * data, crcpp_size size, const Table<CRCType, CRCWidth> & lookupTable, CRCType crc);
|
||||
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
static CRCType CalculateBits(const void * data, crcpp_size size, const Parameters<CRCType, CRCWidth> & parameters);
|
||||
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
static CRCType CalculateBits(const void * data, crcpp_size size, const Parameters<CRCType, CRCWidth> & parameters, CRCType crc);
|
||||
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
static CRCType CalculateBits(const void * data, crcpp_size size, const Table<CRCType, CRCWidth> & lookupTable);
|
||||
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
static CRCType CalculateBits(const void * data, crcpp_size size, const Table<CRCType, CRCWidth> & lookupTable, CRCType crc);
|
||||
|
||||
// Common CRCs up to 64 bits.
|
||||
// Note: Check values are the computed CRCs when given an ASCII input of "123456789" (without null terminator)
|
||||
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
|
||||
@@ -212,16 +230,20 @@ public:
|
||||
static const Parameters< crcpp_uint8, 6> & CRC_6_CDMA2000A();
|
||||
static const Parameters< crcpp_uint8, 6> & CRC_6_CDMA2000B();
|
||||
static const Parameters< crcpp_uint8, 6> & CRC_6_ITU();
|
||||
static const Parameters< crcpp_uint8, 6> & CRC_6_NR();
|
||||
static const Parameters< crcpp_uint8, 7> & CRC_7();
|
||||
#endif
|
||||
static const Parameters< crcpp_uint8, 8> & CRC_8();
|
||||
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
|
||||
static const Parameters< crcpp_uint8, 8> & CRC_8_EBU();
|
||||
static const Parameters< crcpp_uint8, 8> & CRC_8_HDLC();
|
||||
static const Parameters< crcpp_uint8, 8> & CRC_8_MAXIM();
|
||||
static const Parameters< crcpp_uint8, 8> & CRC_8_WCDMA();
|
||||
static const Parameters< crcpp_uint8, 8> & CRC_8_LTE();
|
||||
static const Parameters<crcpp_uint16, 10> & CRC_10();
|
||||
static const Parameters<crcpp_uint16, 10> & CRC_10_CDMA2000();
|
||||
static const Parameters<crcpp_uint16, 11> & CRC_11();
|
||||
static const Parameters<crcpp_uint16, 11> & CRC_11_NR();
|
||||
static const Parameters<crcpp_uint16, 12> & CRC_12_CDMA2000();
|
||||
static const Parameters<crcpp_uint16, 12> & CRC_12_DECT();
|
||||
static const Parameters<crcpp_uint16, 12> & CRC_12_UMTS();
|
||||
@@ -232,8 +254,10 @@ public:
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_ARC();
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_BUYPASS();
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_CCITTFALSE();
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_MCRF4XX();
|
||||
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_CDMA2000();
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_CMS();
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_DECTR();
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_DECTX();
|
||||
static const Parameters<crcpp_uint16, 16> & CRC_16_DNP();
|
||||
@@ -254,6 +278,9 @@ public:
|
||||
static const Parameters<crcpp_uint32, 24> & CRC_24();
|
||||
static const Parameters<crcpp_uint32, 24> & CRC_24_FLEXRAYA();
|
||||
static const Parameters<crcpp_uint32, 24> & CRC_24_FLEXRAYB();
|
||||
static const Parameters<crcpp_uint32, 24> & CRC_24_LTEA();
|
||||
static const Parameters<crcpp_uint32, 24> & CRC_24_LTEB();
|
||||
static const Parameters<crcpp_uint32, 24> & CRC_24_NRC();
|
||||
static const Parameters<crcpp_uint32, 30> & CRC_30();
|
||||
#endif
|
||||
static const Parameters<crcpp_uint32, 32> & CRC_32();
|
||||
@@ -299,8 +326,8 @@ private:
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
static CRCType CalculateRemainder(const void * data, crcpp_size size, const Table<CRCType, CRCWidth> & lookupTable, CRCType remainder);
|
||||
|
||||
template <typename IntegerType>
|
||||
static crcpp_constexpr IntegerType BoundedConstexprValue(IntegerType x);
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
static CRCType CalculateRemainderBits(unsigned char byte, crcpp_size numBits, const Parameters<CRCType, CRCWidth> & parameters, CRCType remainder);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -320,13 +347,13 @@ inline CRC::Table<CRCType, CRCWidth> CRC::Parameters<CRCType, CRCWidth>::MakeTab
|
||||
|
||||
/**
|
||||
@brief Constructs a CRC table from a set of CRC parameters
|
||||
@param[in] parameters CRC parameters
|
||||
@param[in] params CRC parameters
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
*/
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
inline CRC::Table<CRCType, CRCWidth>::Table(const Parameters<CRCType, CRCWidth> & parameters) :
|
||||
parameters(parameters)
|
||||
inline CRC::Table<CRCType, CRCWidth>::Table(const Parameters<CRCType, CRCWidth> & params) :
|
||||
parameters(params)
|
||||
{
|
||||
InitTable();
|
||||
}
|
||||
@@ -334,13 +361,13 @@ inline CRC::Table<CRCType, CRCWidth>::Table(const Parameters<CRCType, CRCWidth>
|
||||
#ifdef CRCPP_USE_CPP11
|
||||
/**
|
||||
@brief Constructs a CRC table from a set of CRC parameters
|
||||
@param[in] parameters CRC parameters
|
||||
@param[in] params CRC parameters
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
*/
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
inline CRC::Table<CRCType, CRCWidth>::Table(Parameters<CRCType, CRCWidth> && parameters) :
|
||||
parameters(::std::move(parameters))
|
||||
inline CRC::Table<CRCType, CRCWidth>::Table(Parameters<CRCType, CRCWidth> && params) :
|
||||
parameters(::std::move(params))
|
||||
{
|
||||
InitTable();
|
||||
}
|
||||
@@ -395,7 +422,8 @@ inline void CRC::Table<CRCType, CRCWidth>::InitTable()
|
||||
static crcpp_constexpr CRCType BIT_MASK((CRCType(1) << (CRCWidth - CRCType(1))) |
|
||||
((CRCType(1) << (CRCWidth - CRCType(1))) - CRCType(1)));
|
||||
|
||||
static crcpp_constexpr CRCType SHIFT(CRC::BoundedConstexprValue(CHAR_BIT - CRCWidth));
|
||||
// The conditional expression is used to avoid a -Wshift-count-overflow warning.
|
||||
static crcpp_constexpr CRCType SHIFT((CHAR_BIT >= CRCWidth) ? static_cast<CRCType>(CHAR_BIT - CRCWidth) : 0);
|
||||
|
||||
CRCType crc;
|
||||
unsigned char byte = 0;
|
||||
@@ -414,7 +442,7 @@ inline void CRC::Table<CRCType, CRCWidth>::InitTable()
|
||||
{
|
||||
// Undo the special operation at the end of the CalculateRemainder()
|
||||
// function for non-reflected CRCs < CHAR_BIT.
|
||||
crc <<= SHIFT;
|
||||
crc = static_cast<CRCType>(crc << SHIFT);
|
||||
}
|
||||
|
||||
table[byte] = crc;
|
||||
@@ -425,7 +453,7 @@ inline void CRC::Table<CRCType, CRCWidth>::InitTable()
|
||||
/**
|
||||
@brief Computes a CRC.
|
||||
@param[in] data Data over which CRC will be computed
|
||||
@param[in] size Size of the data
|
||||
@param[in] size Size of the data, in bytes
|
||||
@param[in] parameters CRC parameters
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
@@ -444,7 +472,7 @@ inline CRCType CRC::Calculate(const void * data, crcpp_size size, const Paramete
|
||||
@brief Appends additional data to a previous CRC calculation.
|
||||
@note This function can be used to compute multi-part CRCs.
|
||||
@param[in] data Data over which CRC will be computed
|
||||
@param[in] size Size of the data
|
||||
@param[in] size Size of the data, in bytes
|
||||
@param[in] parameters CRC parameters
|
||||
@param[in] crc CRC from a previous calculation
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@@ -466,7 +494,7 @@ inline CRCType CRC::Calculate(const void * data, crcpp_size size, const Paramete
|
||||
/**
|
||||
@brief Computes a CRC via a lookup table.
|
||||
@param[in] data Data over which CRC will be computed
|
||||
@param[in] size Size of the data
|
||||
@param[in] size Size of the data, in bytes
|
||||
@param[in] lookupTable CRC lookup table
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
@@ -488,7 +516,7 @@ inline CRCType CRC::Calculate(const void * data, crcpp_size size, const Table<CR
|
||||
@brief Appends additional data to a previous CRC calculation using a lookup table.
|
||||
@note This function can be used to compute multi-part CRCs.
|
||||
@param[in] data Data over which CRC will be computed
|
||||
@param[in] size Size of the data
|
||||
@param[in] size Size of the data, in bytes
|
||||
@param[in] lookupTable CRC lookup table
|
||||
@param[in] crc CRC from a previous calculation
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@@ -509,6 +537,149 @@ inline CRCType CRC::Calculate(const void * data, crcpp_size size, const Table<CR
|
||||
return Finalize<CRCType, CRCWidth>(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Computes a CRC.
|
||||
@param[in] data Data over which CRC will be computed
|
||||
@param[in] size Size of the data, in bits
|
||||
@param[in] parameters CRC parameters
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
@return CRC
|
||||
*/
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
inline CRCType CRC::CalculateBits(const void * data, crcpp_size size, const Parameters<CRCType, CRCWidth> & parameters)
|
||||
{
|
||||
CRCType remainder = parameters.initialValue;
|
||||
|
||||
// Calculate the remainder on a whole number of bytes first, then call
|
||||
// a special-case function for the remaining bits.
|
||||
crcpp_size wholeNumberOfBytes = size / CHAR_BIT;
|
||||
if (wholeNumberOfBytes > 0)
|
||||
{
|
||||
remainder = CalculateRemainder(data, wholeNumberOfBytes, parameters, remainder);
|
||||
}
|
||||
|
||||
crcpp_size remainingNumberOfBits = size % CHAR_BIT;
|
||||
if (remainingNumberOfBits != 0)
|
||||
{
|
||||
unsigned char lastByte = *(reinterpret_cast<const unsigned char *>(data) + wholeNumberOfBytes);
|
||||
remainder = CalculateRemainderBits(lastByte, remainingNumberOfBits, parameters, remainder);
|
||||
}
|
||||
|
||||
// No need to mask the remainder here; the mask will be applied in the Finalize() function.
|
||||
|
||||
return Finalize<CRCType, CRCWidth>(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput);
|
||||
}
|
||||
/**
|
||||
@brief Appends additional data to a previous CRC calculation.
|
||||
@note This function can be used to compute multi-part CRCs.
|
||||
@param[in] data Data over which CRC will be computed
|
||||
@param[in] size Size of the data, in bits
|
||||
@param[in] parameters CRC parameters
|
||||
@param[in] crc CRC from a previous calculation
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
@return CRC
|
||||
*/
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
inline CRCType CRC::CalculateBits(const void * data, crcpp_size size, const Parameters<CRCType, CRCWidth> & parameters, CRCType crc)
|
||||
{
|
||||
CRCType remainder = UndoFinalize<CRCType, CRCWidth>(crc, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput);
|
||||
|
||||
// Calculate the remainder on a whole number of bytes first, then call
|
||||
// a special-case function for the remaining bits.
|
||||
crcpp_size wholeNumberOfBytes = size / CHAR_BIT;
|
||||
if (wholeNumberOfBytes > 0)
|
||||
{
|
||||
remainder = CalculateRemainder(data, wholeNumberOfBytes, parameters, parameters.initialValue);
|
||||
}
|
||||
|
||||
crcpp_size remainingNumberOfBits = size % CHAR_BIT;
|
||||
if (remainingNumberOfBits != 0)
|
||||
{
|
||||
unsigned char lastByte = *(reinterpret_cast<const unsigned char *>(data) + wholeNumberOfBytes);
|
||||
remainder = CalculateRemainderBits(lastByte, remainingNumberOfBits, parameters, remainder);
|
||||
}
|
||||
|
||||
// No need to mask the remainder here; the mask will be applied in the Finalize() function.
|
||||
|
||||
return Finalize<CRCType, CRCWidth>(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Computes a CRC via a lookup table.
|
||||
@param[in] data Data over which CRC will be computed
|
||||
@param[in] size Size of the data, in bits
|
||||
@param[in] lookupTable CRC lookup table
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
@return CRC
|
||||
*/
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
inline CRCType CRC::CalculateBits(const void * data, crcpp_size size, const Table<CRCType, CRCWidth> & lookupTable)
|
||||
{
|
||||
const Parameters<CRCType, CRCWidth> & parameters = lookupTable.GetParameters();
|
||||
|
||||
CRCType remainder = parameters.initialValue;
|
||||
|
||||
// Calculate the remainder on a whole number of bytes first, then call
|
||||
// a special-case function for the remaining bits.
|
||||
crcpp_size wholeNumberOfBytes = size / CHAR_BIT;
|
||||
if (wholeNumberOfBytes > 0)
|
||||
{
|
||||
remainder = CalculateRemainder(data, wholeNumberOfBytes, lookupTable, remainder);
|
||||
}
|
||||
|
||||
crcpp_size remainingNumberOfBits = size % CHAR_BIT;
|
||||
if (remainingNumberOfBits != 0)
|
||||
{
|
||||
unsigned char lastByte = *(reinterpret_cast<const unsigned char *>(data) + wholeNumberOfBytes);
|
||||
remainder = CalculateRemainderBits(lastByte, remainingNumberOfBits, parameters, remainder);
|
||||
}
|
||||
|
||||
// No need to mask the remainder here; the mask will be applied in the Finalize() function.
|
||||
|
||||
return Finalize<CRCType, CRCWidth>(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Appends additional data to a previous CRC calculation using a lookup table.
|
||||
@note This function can be used to compute multi-part CRCs.
|
||||
@param[in] data Data over which CRC will be computed
|
||||
@param[in] size Size of the data, in bits
|
||||
@param[in] lookupTable CRC lookup table
|
||||
@param[in] crc CRC from a previous calculation
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
@return CRC
|
||||
*/
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
inline CRCType CRC::CalculateBits(const void * data, crcpp_size size, const Table<CRCType, CRCWidth> & lookupTable, CRCType crc)
|
||||
{
|
||||
const Parameters<CRCType, CRCWidth> & parameters = lookupTable.GetParameters();
|
||||
|
||||
CRCType remainder = UndoFinalize<CRCType, CRCWidth>(crc, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput);
|
||||
|
||||
// Calculate the remainder on a whole number of bytes first, then call
|
||||
// a special-case function for the remaining bits.
|
||||
crcpp_size wholeNumberOfBytes = size / CHAR_BIT;
|
||||
if (wholeNumberOfBytes > 0)
|
||||
{
|
||||
remainder = CalculateRemainder(data, wholeNumberOfBytes, lookupTable, parameters.initialValue);
|
||||
}
|
||||
|
||||
crcpp_size remainingNumberOfBits = size % CHAR_BIT;
|
||||
if (remainingNumberOfBits > 0)
|
||||
{
|
||||
unsigned char lastByte = *(reinterpret_cast<const unsigned char *>(data) + wholeNumberOfBytes);
|
||||
remainder = CalculateRemainderBits(lastByte, remainingNumberOfBits, parameters, remainder);
|
||||
}
|
||||
|
||||
// No need to mask the remainder here; the mask will be applied in the Finalize() function.
|
||||
|
||||
return Finalize<CRCType, CRCWidth>(remainder, parameters.finalXOR, parameters.reflectInput != parameters.reflectOutput);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Reflects (i.e. reverses the bits within) an integer value.
|
||||
@param[in] value Value to reflect
|
||||
@@ -523,8 +694,8 @@ inline IntegerType CRC::Reflect(IntegerType value, crcpp_uint16 numBits)
|
||||
|
||||
for (crcpp_uint16 i = 0; i < numBits; ++i)
|
||||
{
|
||||
reversedValue = (reversedValue << 1) | (value & 1);
|
||||
value >>= 1;
|
||||
reversedValue = static_cast<IntegerType>((reversedValue << 1) | (value & 1));
|
||||
value = static_cast<IntegerType>(value >> 1);
|
||||
}
|
||||
|
||||
return reversedValue;
|
||||
@@ -591,7 +762,7 @@ inline CRCType CRC::UndoFinalize(CRCType crc, CRCType finalXOR, bool reflectOutp
|
||||
/**
|
||||
@brief Computes a CRC remainder.
|
||||
@param[in] data Data over which the remainder will be computed
|
||||
@param[in] size Size of the data
|
||||
@param[in] size Size of the data, in bytes
|
||||
@param[in] parameters CRC parameters
|
||||
@param[in] remainder Running CRC remainder. Can be an initial value or the result of a previous CRC remainder calculation.
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@@ -620,7 +791,7 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
CRCType polynomial = CRC::Reflect(parameters.polynomial, CRCWidth);
|
||||
while (size--)
|
||||
{
|
||||
remainder ^= *current++;
|
||||
remainder = static_cast<CRCType>(remainder ^ *current++);
|
||||
|
||||
// An optimizing compiler might choose to unroll this loop.
|
||||
for (crcpp_size i = 0; i < CHAR_BIT; ++i)
|
||||
@@ -631,9 +802,9 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
// remainder = (remainder >> 1) ^ polynomial;
|
||||
// else
|
||||
// remainder >>= 1;
|
||||
remainder = (remainder >> 1) ^ ((remainder & 1) * polynomial);
|
||||
remainder = static_cast<CRCType>((remainder >> 1) ^ ((remainder & 1) * polynomial));
|
||||
#else
|
||||
remainder = (remainder & 1) ? ((remainder >> 1) ^ polynomial) : (remainder >> 1);
|
||||
remainder = static_cast<CRCType>((remainder & 1) ? ((remainder >> 1) ^ polynomial) : (remainder >> 1));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -644,11 +815,12 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
#ifndef CRCPP_BRANCHLESS
|
||||
static crcpp_constexpr CRCType CRC_HIGHEST_BIT_MASK(CRCType(1) << CRC_WIDTH_MINUS_ONE);
|
||||
#endif
|
||||
static crcpp_constexpr CRCType SHIFT(BoundedConstexprValue(CRCWidth - CHAR_BIT));
|
||||
// The conditional expression is used to avoid a -Wshift-count-overflow warning.
|
||||
static crcpp_constexpr CRCType SHIFT((CRCWidth >= CHAR_BIT) ? static_cast<CRCType>(CRCWidth - CHAR_BIT) : 0);
|
||||
|
||||
while (size--)
|
||||
{
|
||||
remainder ^= (static_cast<CRCType>(*current++) << SHIFT);
|
||||
remainder = static_cast<CRCType>(remainder ^ (static_cast<CRCType>(*current++) << SHIFT));
|
||||
|
||||
// An optimizing compiler might choose to unroll this loop.
|
||||
for (crcpp_size i = 0; i < CHAR_BIT; ++i)
|
||||
@@ -659,9 +831,9 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
// remainder = (remainder << 1) ^ parameters.polynomial;
|
||||
// else
|
||||
// remainder <<= 1;
|
||||
remainder = (remainder << 1) ^ (((remainder >> CRC_WIDTH_MINUS_ONE) & 1) * parameters.polynomial);
|
||||
remainder = static_cast<CRCType>((remainder << 1) ^ (((remainder >> CRC_WIDTH_MINUS_ONE) & 1) * parameters.polynomial));
|
||||
#else
|
||||
remainder = (remainder & CRC_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ parameters.polynomial) : (remainder << 1);
|
||||
remainder = static_cast<CRCType>((remainder & CRC_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ parameters.polynomial) : (remainder << 1));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -672,14 +844,15 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
#ifndef CRCPP_BRANCHLESS
|
||||
static crcpp_constexpr CRCType CHAR_BIT_HIGHEST_BIT_MASK(CRCType(1) << CHAR_BIT_MINUS_ONE);
|
||||
#endif
|
||||
static crcpp_constexpr CRCType SHIFT(BoundedConstexprValue(CHAR_BIT - CRCWidth));
|
||||
// The conditional expression is used to avoid a -Wshift-count-overflow warning.
|
||||
static crcpp_constexpr CRCType SHIFT((CHAR_BIT >= CRCWidth) ? static_cast<CRCType>(CHAR_BIT - CRCWidth) : 0);
|
||||
|
||||
CRCType polynomial = parameters.polynomial << SHIFT;
|
||||
remainder <<= SHIFT;
|
||||
CRCType polynomial = static_cast<CRCType>(parameters.polynomial << SHIFT);
|
||||
remainder = static_cast<CRCType>(remainder << SHIFT);
|
||||
|
||||
while (size--)
|
||||
{
|
||||
remainder ^= *current++;
|
||||
remainder = static_cast<CRCType>(remainder ^ *current++);
|
||||
|
||||
// An optimizing compiler might choose to unroll this loop.
|
||||
for (crcpp_size i = 0; i < CHAR_BIT; ++i)
|
||||
@@ -690,14 +863,14 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
// remainder = (remainder << 1) ^ polynomial;
|
||||
// else
|
||||
// remainder <<= 1;
|
||||
remainder = (remainder << 1) ^ (((remainder >> CHAR_BIT_MINUS_ONE) & 1) * polynomial);
|
||||
remainder = static_cast<CRCType>((remainder << 1) ^ (((remainder >> CHAR_BIT_MINUS_ONE) & 1) * polynomial));
|
||||
#else
|
||||
remainder = (remainder & CHAR_BIT_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ polynomial) : (remainder << 1);
|
||||
remainder = static_cast<CRCType>((remainder & CHAR_BIT_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ polynomial) : (remainder << 1));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
remainder >>= SHIFT;
|
||||
remainder = static_cast<CRCType>(remainder >> SHIFT);
|
||||
}
|
||||
|
||||
return remainder;
|
||||
@@ -706,7 +879,7 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
/**
|
||||
@brief Computes a CRC remainder using lookup table.
|
||||
@param[in] data Data over which the remainder will be computed
|
||||
@param[in] size Size of the data
|
||||
@param[in] size Size of the data, in bytes
|
||||
@param[in] lookupTable CRC lookup table
|
||||
@param[in] remainder Running CRC remainder. Can be an initial value or the result of a previous CRC remainder calculation.
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@@ -722,37 +895,35 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
{
|
||||
while (size--)
|
||||
{
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
|
||||
#if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
|
||||
// Disable warning about data loss when doing (remainder >> CHAR_BIT) when
|
||||
// remainder is one byte long. The algorithm is still correct in this case,
|
||||
// though it's possible that one additional machine instruction will be executed.
|
||||
# if defined(_MSC_VER)
|
||||
# pragma warning (push)
|
||||
# pragma warning (disable : 4333)
|
||||
# endif
|
||||
#endif
|
||||
remainder = (remainder >> CHAR_BIT) ^ lookupTable[static_cast<unsigned char>(remainder ^ *current++)];
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(WINCE)
|
||||
# if defined(_MSC_VER)
|
||||
remainder = static_cast<CRCType>((remainder >> CHAR_BIT) ^ lookupTable[static_cast<unsigned char>(remainder ^ *current++)]);
|
||||
#if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
|
||||
# pragma warning (pop)
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (CRCWidth >= CHAR_BIT)
|
||||
{
|
||||
static crcpp_constexpr CRCType SHIFT(BoundedConstexprValue(CRCWidth - CHAR_BIT));
|
||||
// The conditional expression is used to avoid a -Wshift-count-overflow warning.
|
||||
static crcpp_constexpr CRCType SHIFT((CRCWidth >= CHAR_BIT) ? static_cast<CRCType>(CRCWidth - CHAR_BIT) : 0);
|
||||
|
||||
while (size--)
|
||||
{
|
||||
remainder = (remainder << CHAR_BIT) ^ lookupTable[static_cast<unsigned char>((remainder >> SHIFT) ^ *current++)];
|
||||
remainder = static_cast<CRCType>((remainder << CHAR_BIT) ^ lookupTable[static_cast<unsigned char>((remainder >> SHIFT) ^ *current++)]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static crcpp_constexpr CRCType SHIFT(BoundedConstexprValue(CHAR_BIT - CRCWidth));
|
||||
// The conditional expression is used to avoid a -Wshift-count-overflow warning.
|
||||
static crcpp_constexpr CRCType SHIFT((CHAR_BIT >= CRCWidth) ? static_cast<CRCType>(CHAR_BIT - CRCWidth) : 0);
|
||||
|
||||
remainder <<= SHIFT;
|
||||
remainder = static_cast<CRCType>(remainder << SHIFT);
|
||||
|
||||
while (size--)
|
||||
{
|
||||
@@ -760,26 +931,94 @@ inline CRCType CRC::CalculateRemainder(const void * data, crcpp_size size, const
|
||||
remainder = lookupTable[static_cast<unsigned char>(remainder ^ *current++)];
|
||||
}
|
||||
|
||||
remainder >>= SHIFT;
|
||||
remainder = static_cast<CRCType>(remainder >> SHIFT);
|
||||
}
|
||||
|
||||
return remainder;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Function to force a compile-time expression to be >= 0.
|
||||
@note This function is used to avoid compiler warnings because all constexpr values are evaluated
|
||||
in a function even in a branch will never be executed. This also means we don't need pragmas
|
||||
to get rid of warnings, but it still can be computed at compile-time. Win-win!
|
||||
@param[in] x Compile-time expression to bound
|
||||
@tparam CRCType Integer type for storing the CRC result
|
||||
@tparam CRCWidth Number of bits in the CRC
|
||||
@return Non-negative compile-time expression
|
||||
*/
|
||||
template <typename IntegerType>
|
||||
inline crcpp_constexpr IntegerType CRC::BoundedConstexprValue(IntegerType x)
|
||||
template <typename CRCType, crcpp_uint16 CRCWidth>
|
||||
inline CRCType CRC::CalculateRemainderBits(unsigned char byte, crcpp_size numBits, const Parameters<CRCType, CRCWidth> & parameters, CRCType remainder)
|
||||
{
|
||||
return (x < IntegerType(0)) ? IntegerType(0) : x;
|
||||
// Slightly different implementations based on the parameters. The current implementations try to eliminate as much
|
||||
// computation from the inner loop (looping over each bit) as possible.
|
||||
if (parameters.reflectInput)
|
||||
{
|
||||
CRCType polynomial = CRC::Reflect(parameters.polynomial, CRCWidth);
|
||||
remainder = static_cast<CRCType>(remainder ^ byte);
|
||||
|
||||
// An optimizing compiler might choose to unroll this loop.
|
||||
for (crcpp_size i = 0; i < numBits; ++i)
|
||||
{
|
||||
#ifdef CRCPP_BRANCHLESS
|
||||
// Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following:
|
||||
// if (remainder & 1)
|
||||
// remainder = (remainder >> 1) ^ polynomial;
|
||||
// else
|
||||
// remainder >>= 1;
|
||||
remainder = static_cast<CRCType>((remainder >> 1) ^ ((remainder & 1) * polynomial));
|
||||
#else
|
||||
remainder = static_cast<CRCType>((remainder & 1) ? ((remainder >> 1) ^ polynomial) : (remainder >> 1));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (CRCWidth >= CHAR_BIT)
|
||||
{
|
||||
static crcpp_constexpr CRCType CRC_WIDTH_MINUS_ONE(CRCWidth - CRCType(1));
|
||||
#ifndef CRCPP_BRANCHLESS
|
||||
static crcpp_constexpr CRCType CRC_HIGHEST_BIT_MASK(CRCType(1) << CRC_WIDTH_MINUS_ONE);
|
||||
#endif
|
||||
// The conditional expression is used to avoid a -Wshift-count-overflow warning.
|
||||
static crcpp_constexpr CRCType SHIFT((CRCWidth >= CHAR_BIT) ? static_cast<CRCType>(CRCWidth - CHAR_BIT) : 0);
|
||||
|
||||
remainder = static_cast<CRCType>(remainder ^ (static_cast<CRCType>(byte) << SHIFT));
|
||||
|
||||
// An optimizing compiler might choose to unroll this loop.
|
||||
for (crcpp_size i = 0; i < numBits; ++i)
|
||||
{
|
||||
#ifdef CRCPP_BRANCHLESS
|
||||
// Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following:
|
||||
// if (remainder & CRC_HIGHEST_BIT_MASK)
|
||||
// remainder = (remainder << 1) ^ parameters.polynomial;
|
||||
// else
|
||||
// remainder <<= 1;
|
||||
remainder = static_cast<CRCType>((remainder << 1) ^ (((remainder >> CRC_WIDTH_MINUS_ONE) & 1) * parameters.polynomial));
|
||||
#else
|
||||
remainder = static_cast<CRCType>((remainder & CRC_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ parameters.polynomial) : (remainder << 1));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static crcpp_constexpr CRCType CHAR_BIT_MINUS_ONE(CHAR_BIT - 1);
|
||||
#ifndef CRCPP_BRANCHLESS
|
||||
static crcpp_constexpr CRCType CHAR_BIT_HIGHEST_BIT_MASK(CRCType(1) << CHAR_BIT_MINUS_ONE);
|
||||
#endif
|
||||
// The conditional expression is used to avoid a -Wshift-count-overflow warning.
|
||||
static crcpp_constexpr CRCType SHIFT((CHAR_BIT >= CRCWidth) ? static_cast<CRCType>(CHAR_BIT - CRCWidth) : 0);
|
||||
|
||||
CRCType polynomial = static_cast<CRCType>(parameters.polynomial << SHIFT);
|
||||
remainder = static_cast<CRCType>((remainder << SHIFT) ^ byte);
|
||||
|
||||
// An optimizing compiler might choose to unroll this loop.
|
||||
for (crcpp_size i = 0; i < numBits; ++i)
|
||||
{
|
||||
#ifdef CRCPP_BRANCHLESS
|
||||
// Clever way to avoid a branch at the expense of a multiplication. This code is equivalent to the following:
|
||||
// if (remainder & CHAR_BIT_HIGHEST_BIT_MASK)
|
||||
// remainder = (remainder << 1) ^ polynomial;
|
||||
// else
|
||||
// remainder <<= 1;
|
||||
remainder = static_cast<CRCType>((remainder << 1) ^ (((remainder >> CHAR_BIT_MINUS_ONE) & 1) * polynomial));
|
||||
#else
|
||||
remainder = static_cast<CRCType>((remainder & CHAR_BIT_HIGHEST_BIT_MASK) ? ((remainder << 1) ^ polynomial) : (remainder << 1));
|
||||
#endif
|
||||
}
|
||||
|
||||
remainder = static_cast<CRCType>(remainder >> SHIFT);
|
||||
}
|
||||
|
||||
return remainder;
|
||||
}
|
||||
|
||||
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
|
||||
@@ -909,6 +1148,25 @@ inline const CRC::Parameters<crcpp_uint8, 6> & CRC::CRC_6_ITU()
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-6 NR.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory
|
||||
footprint.
|
||||
@note CRC-6 NR has the following parameters and check value:
|
||||
- polynomial = 0x21
|
||||
- initial value = 0x00
|
||||
- final XOR = 0x00
|
||||
- reflect input = false
|
||||
- reflect output = false
|
||||
- check value = 0x15
|
||||
@return CRC-6 NR parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint8, 6> & CRC::CRC_6_NR()
|
||||
{
|
||||
static const Parameters<crcpp_uint8, 6> parameters = { 0x21, 0x00, 0x00, false, false };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-7 JEDEC.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@@ -965,6 +1223,24 @@ inline const CRC::Parameters<crcpp_uint8, 8> & CRC::CRC_8_EBU()
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-8 HDLC (ISO/IEC 13239:2002).
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@note CRC-8 HDLC has the following parameters and check value:
|
||||
- polynomial = 0x07
|
||||
- initial value = 0xFF
|
||||
- final XOR = 0xFF
|
||||
- reflect input = true
|
||||
- reflect output = true
|
||||
- check value = 0x2F
|
||||
@return CRC-8 HDLC parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint8, 8> & CRC::CRC_8_HDLC()
|
||||
{
|
||||
static const Parameters<crcpp_uint8, 8> parameters = { 0x07, 0xFF, 0xFF, true, true };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-8 MAXIM (aka CRC-8 DOW-CRC).
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@@ -1001,6 +1277,24 @@ inline const CRC::Parameters<crcpp_uint8, 8> & CRC::CRC_8_WCDMA()
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-8 LTE.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@note CRC-8 LTE has the following parameters and check value:
|
||||
- polynomial = 0x9B
|
||||
- initial value = 0x00
|
||||
- final XOR = 0x00
|
||||
- reflect input = false
|
||||
- reflect output = false
|
||||
- check value = 0xEA
|
||||
@return CRC-8 LTE parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint8, 8> & CRC::CRC_8_LTE()
|
||||
{
|
||||
static const Parameters<crcpp_uint8, 8> parameters = { 0x9B, 0x00, 0x00, false, false };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-10 ITU.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@@ -1055,6 +1349,25 @@ inline const CRC::Parameters<crcpp_uint16, 11> & CRC::CRC_11()
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-11 NR.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory
|
||||
footprint.
|
||||
@note CRC-11 NR has the following parameters and check value:
|
||||
- polynomial = 0x621
|
||||
- initial value = 0x000
|
||||
- final XOR = 0x000
|
||||
- reflect input = false
|
||||
- reflect output = false
|
||||
- check value = 0x5CA
|
||||
@return CRC-11 NR parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint16, 11> & CRC::CRC_11_NR()
|
||||
{
|
||||
static const Parameters<crcpp_uint16, 11> parameters = { 0x621, 0x000, 0x000, false, false };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-12 CDMA2000.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@@ -1218,6 +1531,24 @@ inline const CRC::Parameters<crcpp_uint16, 16> & CRC::CRC_16_CCITTFALSE()
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-16 MCRF4XX.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@note CRC-16 MCRF4XX has the following parameters and check value:
|
||||
- polynomial = 0x1021
|
||||
- initial value = 0xFFFF
|
||||
- final XOR = 0x0000
|
||||
- reflect input = true
|
||||
- reflect output = true
|
||||
- check value = 0x6F91
|
||||
@return CRC-16 MCRF4XX parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint16, 16> & CRC::CRC_16_MCRF4XX()
|
||||
{
|
||||
static const Parameters<crcpp_uint16, 16> parameters = { 0x1021, 0xFFFF, 0x0000, true, true};
|
||||
return parameters;
|
||||
}
|
||||
|
||||
#ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-16 CDMA2000.
|
||||
@@ -1237,6 +1568,24 @@ inline const CRC::Parameters<crcpp_uint16, 16> & CRC::CRC_16_CDMA2000()
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-16 CMS.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@note CRC-16 CMS has the following parameters and check value:
|
||||
- polynomial = 0x8005
|
||||
- initial value = 0xFFFF
|
||||
- final XOR = 0x0000
|
||||
- reflect input = false
|
||||
- reflect output = false
|
||||
- check value = 0xAEE7
|
||||
@return CRC-16 CMS parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint16, 16> & CRC::CRC_16_CMS()
|
||||
{
|
||||
static const Parameters<crcpp_uint16, 16> parameters = { 0x8005, 0xFFFF, 0x0000, false, false };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-16 DECT-R (aka CRC-16 R-CRC).
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@@ -1400,6 +1749,7 @@ inline const CRC::Parameters<crcpp_uint16, 16> & CRC::CRC_16_USB()
|
||||
static const Parameters<crcpp_uint16, 16> parameters = { 0x8005, 0xFFFF, 0xFFFF, true, true };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
#endif // CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS
|
||||
|
||||
/**
|
||||
@@ -1529,6 +1879,63 @@ inline const CRC::Parameters<crcpp_uint32, 24> & CRC::CRC_24_FLEXRAYB()
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-24 LTE-A/NR-A.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory
|
||||
footprint.
|
||||
@note CRC-24 LTE-A has the following parameters and check value:
|
||||
- polynomial = 0x864CFB
|
||||
- initial value = 0x000000
|
||||
- final XOR = 0x000000
|
||||
- reflect input = false
|
||||
- reflect output = false
|
||||
- check value = 0xCDE703
|
||||
@return CRC-24 LTE-A parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint32, 24> & CRC::CRC_24_LTEA()
|
||||
{
|
||||
static const Parameters<crcpp_uint32, 24> parameters = { 0x864CFB, 0x000000, 0x000000, false, false };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-24 LTE-B/NR-B.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory
|
||||
footprint.
|
||||
@note CRC-24 LTE-B has the following parameters and check value:
|
||||
- polynomial = 0x800063
|
||||
- initial value = 0x000000
|
||||
- final XOR = 0x000000
|
||||
- reflect input = false
|
||||
- reflect output = false
|
||||
- check value = 0x23EF52
|
||||
@return CRC-24 LTE-B parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint32, 24> & CRC::CRC_24_LTEB()
|
||||
{
|
||||
static const Parameters<crcpp_uint32, 24> parameters = { 0x800063, 0x000000, 0x000000, false, false };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-24 NR-C.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory
|
||||
footprint.
|
||||
@note CRC-24 NR-C has the following parameters and check value:
|
||||
- polynomial = 0xB2B117
|
||||
- initial value = 0x000000
|
||||
- final XOR = 0x000000
|
||||
- reflect input = false
|
||||
- reflect output = false
|
||||
- check value = 0xF48279
|
||||
@return CRC-24 NR-C parameters
|
||||
*/
|
||||
inline const CRC::Parameters<crcpp_uint32, 24> & CRC::CRC_24_NRC()
|
||||
{
|
||||
static const Parameters<crcpp_uint32, 24> parameters = { 0xB2B117, 0x000000, 0x000000, false, false };
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Returns a set of parameters for CRC-30 CDMA.
|
||||
@note The parameters are static and are delayed-constructed to reduce memory footprint.
|
||||
@@ -1700,4 +2107,8 @@ inline const CRC::Parameters<crcpp_uint64, 64> & CRC::CRC_64()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#endif // CRCPP_CRC_H_
|
||||
|
||||
+8
-6
@@ -1,13 +1,14 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Copyright 2020 Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
target_sources( ${PROJECT_NAME}
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57Exception.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57Format.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57SimpleData.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57SimpleReader.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57SimpleWriter.h
|
||||
E57Exception.h
|
||||
E57Format.h
|
||||
E57SimpleData.h
|
||||
E57SimpleReader.h
|
||||
E57SimpleWriter.h
|
||||
E57Version.h
|
||||
)
|
||||
|
||||
#install(
|
||||
@@ -17,6 +18,7 @@ target_sources( ${PROJECT_NAME}
|
||||
# E57SimpleData.h
|
||||
# E57SimpleReader.h
|
||||
# E57SimpleWriter.h
|
||||
# E57Version.h
|
||||
# DESTINATION
|
||||
# include/E57Format
|
||||
#)
|
||||
|
||||
+340
-80
@@ -27,110 +27,370 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
/// @file E57Exception.h Exception handling for E57 API.
|
||||
|
||||
#include <exception>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "E57Export.h"
|
||||
|
||||
#ifndef E57_ENABLE_DIAGNOSTIC_OUTPUT
|
||||
// Used to mark unused parameters to indicate intent and suppress warnings.
|
||||
#define E57_UNUSED( expr ) (void)( expr )
|
||||
#endif
|
||||
|
||||
// C++14 does not support the [[deprecated]] attribute on enumerators.
|
||||
// Turn on enumerator deprecation notices if we are compiling with C++17 or later.
|
||||
#if ( ( defined( _MSVC_LANG ) && _MSVC_LANG >= 201703L ) || __cplusplus >= 201703L )
|
||||
#define E57_DEPRECATED_ENUM( str ) [[deprecated( str )]]
|
||||
#else
|
||||
#define E57_DEPRECATED_ENUM( str )
|
||||
#endif
|
||||
|
||||
namespace e57
|
||||
{
|
||||
//! @brief Numeric error identifiers used in E57Exception
|
||||
/// @brief Numeric error identifiers used in E57Exception
|
||||
enum ErrorCode
|
||||
{
|
||||
// N.B. *** When changing error strings here, remember to update the error
|
||||
// strings in E57Exception.cpp ****
|
||||
E57_SUCCESS = 0, //!< operation was successful
|
||||
E57_ERROR_BAD_CV_HEADER = 1, //!< a CompressedVector binary header was bad
|
||||
E57_ERROR_BAD_CV_PACKET = 2, //!< a CompressedVector binary packet was bad
|
||||
E57_ERROR_CHILD_INDEX_OUT_OF_BOUNDS = 3, //!< a numerical index identifying a child was out of bounds
|
||||
E57_ERROR_SET_TWICE = 4, //!< attempted to set an existing child element to a new value
|
||||
E57_ERROR_HOMOGENEOUS_VIOLATION = 5, //!< attempted to add an E57 Element that would have made the children
|
||||
//!< of a homogeneous Vector have different types
|
||||
E57_ERROR_VALUE_NOT_REPRESENTABLE = 6, //!< a value could not be represented in the requested type
|
||||
E57_ERROR_SCALED_VALUE_NOT_REPRESENTABLE = 7, //!< after scaling the result could not be represented in the
|
||||
//!< requested type
|
||||
E57_ERROR_REAL64_TOO_LARGE = 8, //!< a 64 bit IEEE float was too large to store in a 32 bit IEEE float
|
||||
E57_ERROR_EXPECTING_NUMERIC = 9, //!< Expecting numeric representation in user's buffer, found ustring
|
||||
E57_ERROR_EXPECTING_USTRING = 10, //!< Expecting string representation in user's buffer, found numeric
|
||||
E57_ERROR_INTERNAL = 11, //!< An unrecoverable inconsistent internal state was detected
|
||||
E57_ERROR_BAD_XML_FORMAT = 12, //!< E57 primitive not encoded in XML correctly
|
||||
E57_ERROR_XML_PARSER = 13, //!< XML not well formed
|
||||
E57_ERROR_BAD_API_ARGUMENT = 14, //!< bad API function argument provided by user
|
||||
E57_ERROR_FILE_IS_READ_ONLY = 15, //!< can't modify read only file
|
||||
E57_ERROR_BAD_CHECKSUM = 16, //!< checksum mismatch, file is corrupted
|
||||
E57_ERROR_OPEN_FAILED = 17, //!< open() failed
|
||||
E57_ERROR_CLOSE_FAILED = 18, //!< close() failed
|
||||
E57_ERROR_READ_FAILED = 19, //!< read() failed
|
||||
E57_ERROR_WRITE_FAILED = 20, //!< write() failed
|
||||
E57_ERROR_LSEEK_FAILED = 21, //!< lseek() failed
|
||||
E57_ERROR_PATH_UNDEFINED = 22, //!< E57 element path well formed but not defined
|
||||
E57_ERROR_BAD_BUFFER = 23, //!< bad SourceDestBuffer
|
||||
E57_ERROR_NO_BUFFER_FOR_ELEMENT = 24, //!< no buffer specified for an element in CompressedVectorNode during
|
||||
//!< write
|
||||
E57_ERROR_BUFFER_SIZE_MISMATCH = 25, //!< SourceDestBuffers not all same size
|
||||
E57_ERROR_BUFFER_DUPLICATE_PATHNAME = 26, //!< duplicate pathname in CompressedVectorNode read/write
|
||||
E57_ERROR_BAD_FILE_SIGNATURE = 27, //!< file signature not "ASTM-E57"
|
||||
E57_ERROR_UNKNOWN_FILE_VERSION = 28, //!< incompatible file version
|
||||
E57_ERROR_BAD_FILE_LENGTH = 29, //!< size in file header not same as actual
|
||||
E57_ERROR_XML_PARSER_INIT = 30, //!< XML parser failed to initialize
|
||||
E57_ERROR_DUPLICATE_NAMESPACE_PREFIX = 31, //!< namespace prefix already defined
|
||||
E57_ERROR_DUPLICATE_NAMESPACE_URI = 32, //!< namespace URI already defined
|
||||
E57_ERROR_BAD_PROTOTYPE = 33, //!< bad prototype in CompressedVectorNode
|
||||
E57_ERROR_BAD_CODECS = 34, //!< bad codecs in CompressedVectorNode
|
||||
E57_ERROR_VALUE_OUT_OF_BOUNDS = 35, //!< element value out of min/max bounds
|
||||
E57_ERROR_CONVERSION_REQUIRED = 36, //!< conversion required to assign element value, but not requested
|
||||
E57_ERROR_BAD_PATH_NAME = 37, //!< E57 path name is not well formed
|
||||
E57_ERROR_NOT_IMPLEMENTED = 38, //!< functionality not implemented
|
||||
E57_ERROR_BAD_NODE_DOWNCAST = 39, //!< bad downcast from Node to specific node type
|
||||
E57_ERROR_WRITER_NOT_OPEN = 40, //!< CompressedVectorWriter is no longer open
|
||||
E57_ERROR_READER_NOT_OPEN = 41, //!< CompressedVectorReader is no longer open
|
||||
E57_ERROR_NODE_UNATTACHED = 42, //!< node is not yet attached to tree of ImageFile
|
||||
E57_ERROR_ALREADY_HAS_PARENT = 43, //!< node already has a parent
|
||||
E57_ERROR_DIFFERENT_DEST_IMAGEFILE = 44, //!< nodes were constructed with different destImageFiles
|
||||
E57_ERROR_IMAGEFILE_NOT_OPEN = 45, //!< destImageFile is no longer open
|
||||
E57_ERROR_BUFFERS_NOT_COMPATIBLE = 46, //!< SourceDestBuffers not compatible with previously given ones
|
||||
E57_ERROR_TOO_MANY_WRITERS = 47, //!< too many open CompressedVectorWriters of an ImageFile
|
||||
E57_ERROR_TOO_MANY_READERS = 48, //!< too many open CompressedVectorReaders of an ImageFile
|
||||
E57_ERROR_BAD_CONFIGURATION = 49, //!< bad configuration string
|
||||
E57_ERROR_INVARIANCE_VIOLATION = 50 //!< class invariance constraint violation in debug mode
|
||||
// NOTE: When changing error strings here, remember to update the error strings in
|
||||
// E57Exception.cpp
|
||||
|
||||
Success = 0, ///< operation was successful
|
||||
|
||||
ErrorBadCVHeader = 1, ///< a CompressedVector binary header was bad
|
||||
ErrorBadCVPacket = 2, ///< a CompressedVector binary packet was bad
|
||||
ErrorChildIndexOutOfBounds = 3, ///< a numerical index identifying a child was out of bounds
|
||||
ErrorSetTwice = 4, ///< attempted to set an existing child element to a new value
|
||||
|
||||
/// @brief attempted to add an element that would have made the children of a homogeneous
|
||||
/// ::TypeVector have different types
|
||||
ErrorHomogeneousViolation = 5,
|
||||
|
||||
/// a value could not be represented in the requested type
|
||||
ErrorValueNotRepresentable = 6,
|
||||
|
||||
/// after scaling the result could not be represented in the requested type
|
||||
ErrorScaledValueNotRepresentable = 7,
|
||||
|
||||
/// a 64 bit IEEE float was too large to store in a 32 bit IEEE float
|
||||
ErrorReal64TooLarge = 8,
|
||||
|
||||
/// expecting numeric representation in user's buffer, found ustring
|
||||
ErrorExpectingNumeric = 9,
|
||||
|
||||
/// expecting string representation in user's buffer, found numeric
|
||||
ErrorExpectingUString = 10,
|
||||
|
||||
ErrorInternal = 11, ///< An unrecoverable inconsistent internal state was detected
|
||||
ErrorBadXMLFormat = 12, ///< E57 primitive not encoded in XML correctly
|
||||
ErrorXMLParser = 13, ///< XML not well formed
|
||||
ErrorBadAPIArgument = 14, ///< bad API function argument provided by user
|
||||
ErrorFileReadOnly = 15, ///< can't modify read only file
|
||||
ErrorBadChecksum = 16, ///< checksum mismatch, file is corrupted
|
||||
ErrorOpenFailed = 17, ///< open() failed
|
||||
ErrorCloseFailed = 18, ///< close() failed
|
||||
ErrorReadFailed = 19, ///< read() failed
|
||||
ErrorWriteFailed = 20, ///< write() failed
|
||||
ErrorSeekFailed = 21, ///< lseek() failed
|
||||
ErrorPathUndefined = 22, ///< element path well formed but not defined
|
||||
ErrorBadBuffer = 23, ///< bad SourceDestBuffer
|
||||
|
||||
/// no buffer specified for an element in CompressedVectorNode during write
|
||||
ErrorNoBufferForElement = 24,
|
||||
|
||||
ErrorBufferSizeMismatch = 25, ///< SourceDestBuffers not all same size
|
||||
ErrorBufferDuplicatePathName = 26, ///< duplicate pathname in CompressedVectorNode read/write
|
||||
ErrorBadFileSignature = 27, ///< file signature not "ASTM-E57"
|
||||
ErrorUnknownFileVersion = 28, ///< incompatible file version
|
||||
ErrorBadFileLength = 29, ///< size in file header not same as actual
|
||||
ErrorXMLParserInit = 30, ///< XML parser failed to initialize
|
||||
ErrorDuplicateNamespacePrefix = 31, ///< namespace prefix already defined
|
||||
ErrorDuplicateNamespaceURI = 32, ///< namespace URI already defined
|
||||
ErrorBadPrototype = 33, ///< bad prototype in CompressedVectorNode
|
||||
ErrorBadCodecs = 34, ///< bad codecs in CompressedVectorNode
|
||||
ErrorValueOutOfBounds = 35, ///< element value out of min/max bounds
|
||||
|
||||
/// conversion required to assign element value, but not requested
|
||||
ErrorConversionRequired = 36,
|
||||
|
||||
ErrorBadPathName = 37, ///< E57 path name is not well formed
|
||||
ErrorNotImplemented = 38, ///< functionality not implemented
|
||||
ErrorBadNodeDowncast = 39, ///< bad downcast from Node to specific node type
|
||||
ErrorWriterNotOpen = 40, ///< CompressedVectorWriter is no longer open
|
||||
ErrorReaderNotOpen = 41, ///< CompressedVectorReader is no longer open
|
||||
ErrorNodeUnattached = 42, ///< node is not yet attached to tree of ImageFile
|
||||
ErrorAlreadyHasParent = 43, ///< node already has a parent
|
||||
ErrorDifferentDestImageFile = 44, ///< nodes were constructed with different destImageFiles
|
||||
ErrorImageFileNotOpen = 45, ///< destImageFile is no longer open
|
||||
|
||||
/// SourceDestBuffers not compatible with previously given ones
|
||||
ErrorBuffersNotCompatible = 46,
|
||||
|
||||
ErrorTooManyWriters = 47, ///< too many open CompressedVectorWriters of an ImageFile
|
||||
ErrorTooManyReaders = 48, ///< too many open CompressedVectorReaders of an ImageFile
|
||||
ErrorBadConfiguration = 49, ///< bad configuration string
|
||||
ErrorInvarianceViolation = 50, ///< class invariance constraint violation in debug mode
|
||||
|
||||
/// an invalid node type was passed in Data3D pointFields
|
||||
ErrorInvalidNodeType = 51,
|
||||
|
||||
/// passed an invalid value in Data3D pointFields
|
||||
ErrorInvalidData3DValue = 52,
|
||||
|
||||
/// Older versions of this library (and E57RefImpl) incorrectly set the "fileOffset" to 0
|
||||
/// when "recordCount" is 0. "fileOffset" must be greater than 0 (Table 9 in the standard).
|
||||
ErrorData3DReadInvalidZeroRecords = 53,
|
||||
|
||||
/// @deprecated Will be removed in 4.0. Use e57::Success.
|
||||
E57_SUCCESS E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use Success." ) = Success,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadCVHeader.
|
||||
E57_ERROR_BAD_CV_HEADER E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadCVHeader." ) = ErrorBadCVHeader,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadCVPacket.
|
||||
E57_ERROR_BAD_CV_PACKET E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadCVPacket." ) = ErrorBadCVPacket,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorChildIndexOutOfBounds.
|
||||
E57_ERROR_CHILD_INDEX_OUT_OF_BOUNDS E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorChildIndexOutOfBounds." ) = ErrorChildIndexOutOfBounds,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorSetTwice.
|
||||
E57_ERROR_SET_TWICE E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ErrorSetTwice." ) =
|
||||
ErrorSetTwice,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorHomogeneousViolation.
|
||||
E57_ERROR_HOMOGENEOUS_VIOLATION E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorHomogeneousViolation." ) = ErrorHomogeneousViolation,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorValueNotRepresentable.
|
||||
E57_ERROR_VALUE_NOT_REPRESENTABLE E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorValueNotRepresentable." ) = ErrorValueNotRepresentable,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorScaledValueNotRepresentable.
|
||||
E57_ERROR_SCALED_VALUE_NOT_REPRESENTABLE E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorScaledValueNotRepresentable." ) =
|
||||
ErrorScaledValueNotRepresentable,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorReal64TooLarge.
|
||||
E57_ERROR_REAL64_TOO_LARGE E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorReal64TooLarge." ) = ErrorReal64TooLarge,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorExpectingNumeric.
|
||||
E57_ERROR_EXPECTING_NUMERIC E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorExpectingNumeric." ) = ErrorExpectingNumeric,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorExpectingUString.
|
||||
E57_ERROR_EXPECTING_USTRING E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorExpectingUString." ) = ErrorExpectingUString,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorInternal.
|
||||
E57_ERROR_INTERNAL E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ErrorInternal." ) =
|
||||
ErrorInternal,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadXMLFormat.
|
||||
E57_ERROR_BAD_XML_FORMAT E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadXMLFormat." ) = ErrorBadXMLFormat,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorXMLParser.
|
||||
E57_ERROR_XML_PARSER E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ErrorXMLParser." ) =
|
||||
ErrorXMLParser,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadAPIArgument.
|
||||
E57_ERROR_BAD_API_ARGUMENT E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadAPIArgument." ) = ErrorBadAPIArgument,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorFileReadOnly.
|
||||
E57_ERROR_FILE_IS_READ_ONLY E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorFileReadOnly." ) = ErrorFileReadOnly,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadChecksum.
|
||||
E57_ERROR_BAD_CHECKSUM E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadChecksum." ) = ErrorBadChecksum,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorOpenFailed.
|
||||
E57_ERROR_OPEN_FAILED E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ErrorOpenFailed." ) =
|
||||
ErrorOpenFailed,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorCloseFailed.
|
||||
E57_ERROR_CLOSE_FAILED E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorCloseFailed." ) = ErrorCloseFailed,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorReadFailed.
|
||||
E57_ERROR_READ_FAILED E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ErrorReadFailed." ) =
|
||||
ErrorReadFailed,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorWriteFailed.
|
||||
E57_ERROR_WRITE_FAILED E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorWriteFailed." ) = ErrorWriteFailed,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorSeekFailed.
|
||||
E57_ERROR_LSEEK_FAILED E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ErrorSeekFailed." ) =
|
||||
ErrorSeekFailed,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorPathUndefined.
|
||||
E57_ERROR_PATH_UNDEFINED E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorPathUndefined." ) = ErrorPathUndefined,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadBuffer.
|
||||
E57_ERROR_BAD_BUFFER E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ErrorBadBuffer." ) =
|
||||
ErrorBadBuffer,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorNoBufferForElement.
|
||||
E57_ERROR_NO_BUFFER_FOR_ELEMENT E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorNoBufferForElement." ) = ErrorNoBufferForElement,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBufferSizeMismatch.
|
||||
E57_ERROR_BUFFER_SIZE_MISMATCH E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBufferSizeMismatch." ) = ErrorBufferSizeMismatch,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBufferDuplicatePathName.
|
||||
E57_ERROR_BUFFER_DUPLICATE_PATHNAME E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBufferDuplicatePathName." ) =
|
||||
ErrorBufferDuplicatePathName,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadFileSignature.
|
||||
E57_ERROR_BAD_FILE_SIGNATURE E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadFileSignature." ) = ErrorBadFileSignature,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorUnknownFileVersion.
|
||||
E57_ERROR_UNKNOWN_FILE_VERSION E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorUnknownFileVersion." ) = ErrorUnknownFileVersion,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadFileLength.
|
||||
E57_ERROR_BAD_FILE_LENGTH E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadFileLength." ) = ErrorBadFileLength,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorXMLParserInit.
|
||||
E57_ERROR_XML_PARSER_INIT E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorXMLParserInit." ) = ErrorXMLParserInit,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorDuplicateNamespacePrefix.
|
||||
E57_ERROR_DUPLICATE_NAMESPACE_PREFIX E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorDuplicateNamespacePrefix." ) =
|
||||
ErrorDuplicateNamespacePrefix,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorDuplicateNamespaceURI.
|
||||
E57_ERROR_DUPLICATE_NAMESPACE_URI E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorDuplicateNamespaceURI." ) = ErrorDuplicateNamespaceURI,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadPrototype.
|
||||
E57_ERROR_BAD_PROTOTYPE E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadPrototype." ) = ErrorBadPrototype,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadCodecs.
|
||||
E57_ERROR_BAD_CODECS E57_DEPRECATED_ENUM( "Will be removed in 4.0. Use ErrorBadCodecs." ) =
|
||||
ErrorBadCodecs,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorValueOutOfBounds.
|
||||
E57_ERROR_VALUE_OUT_OF_BOUNDS E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorValueOutOfBounds." ) = ErrorValueOutOfBounds,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorConversionRequired.
|
||||
E57_ERROR_CONVERSION_REQUIRED E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorConversionRequired." ) = ErrorConversionRequired,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadPathName.
|
||||
E57_ERROR_BAD_PATH_NAME E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadPathName." ) = ErrorBadPathName,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorNotImplemented.
|
||||
E57_ERROR_NOT_IMPLEMENTED E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorNotImplemented." ) = ErrorNotImplemented,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadNodeDowncast.
|
||||
E57_ERROR_BAD_NODE_DOWNCAST E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadNodeDowncast." ) = ErrorBadNodeDowncast,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorWriterNotOpen.
|
||||
E57_ERROR_WRITER_NOT_OPEN E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorWriterNotOpen." ) = ErrorWriterNotOpen,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorReaderNotOpen.
|
||||
E57_ERROR_READER_NOT_OPEN E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorReaderNotOpen." ) = ErrorReaderNotOpen,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorNodeUnattached.
|
||||
E57_ERROR_NODE_UNATTACHED E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorNodeUnattached." ) = ErrorNodeUnattached,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorAlreadyHasParent.
|
||||
E57_ERROR_ALREADY_HAS_PARENT E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorAlreadyHasParent." ) = ErrorAlreadyHasParent,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorDifferentDestImageFile.
|
||||
E57_ERROR_DIFFERENT_DEST_IMAGEFILE E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorDifferentDestImageFile." ) = ErrorDifferentDestImageFile,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorImageFileNotOpen.
|
||||
E57_ERROR_IMAGEFILE_NOT_OPEN E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorImageFileNotOpen." ) = ErrorImageFileNotOpen,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBuffersNotCompatible.
|
||||
E57_ERROR_BUFFERS_NOT_COMPATIBLE E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBuffersNotCompatible." ) = ErrorBuffersNotCompatible,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorTooManyWriters.
|
||||
E57_ERROR_TOO_MANY_WRITERS E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorTooManyWriters." ) = ErrorTooManyWriters,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorTooManyReaders.
|
||||
E57_ERROR_TOO_MANY_READERS E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorTooManyReaders." ) = ErrorTooManyReaders,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorBadConfiguration.
|
||||
E57_ERROR_BAD_CONFIGURATION E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorBadConfiguration." ) = ErrorBadConfiguration,
|
||||
/// @deprecated Will be removed in 4.0. Use e57::ErrorInvarianceViolation.
|
||||
E57_ERROR_INVARIANCE_VIOLATION E57_DEPRECATED_ENUM(
|
||||
"Will be removed in 4.0. Use ErrorInvarianceViolation." ) = ErrorInvarianceViolation,
|
||||
};
|
||||
|
||||
class E57_DLL E57Exception : public std::exception
|
||||
namespace Utilities
|
||||
{
|
||||
E57_DLL std::string errorCodeToString( ErrorCode ecode ) noexcept;
|
||||
}
|
||||
|
||||
class E57Exception : public std::exception
|
||||
{
|
||||
public:
|
||||
const char *what() const noexcept override
|
||||
{
|
||||
return "E57 exception";
|
||||
}
|
||||
|
||||
void report( const char *reportingFileName = nullptr, int reportingLineNumber = 0,
|
||||
const char *reportingFunctionName = nullptr, std::ostream &os = std::cout ) const;
|
||||
ErrorCode errorCode() const;
|
||||
std::string context() const;
|
||||
const char *what() const noexcept override;
|
||||
const char *reportingFunctionName = nullptr,
|
||||
std::ostream &os = std::cout ) const noexcept
|
||||
{
|
||||
os << "**** Got an e57 exception: " << errorStr() << std::endl;
|
||||
|
||||
#ifdef E57_ENABLE_DIAGNOSTIC_OUTPUT
|
||||
os << " Debug info: " << std::endl;
|
||||
os << " context: " << context_ << std::endl;
|
||||
os << " sourceFunctionName: " << sourceFunctionName_ << std::endl;
|
||||
if ( reportingFunctionName != nullptr )
|
||||
{
|
||||
os << " reportingFunctionName: " << reportingFunctionName << std::endl;
|
||||
}
|
||||
|
||||
/*** Add a line in error message that a smart editor (gnu emacs) can
|
||||
* interpret as a link to the source code: */
|
||||
os << sourceFileName_ << "(" << sourceLineNumber_ << ") : error C" << errorCode_
|
||||
<< ": <--- occurred on" << std::endl;
|
||||
if ( reportingFileName != nullptr )
|
||||
{
|
||||
os << reportingFileName << "(" << reportingLineNumber
|
||||
<< ") : error C0: <--- reported on" << std::endl;
|
||||
}
|
||||
#else
|
||||
E57_UNUSED( reportingFileName );
|
||||
E57_UNUSED( reportingLineNumber );
|
||||
E57_UNUSED( reportingFunctionName );
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorCode errorCode() const noexcept
|
||||
{
|
||||
return errorCode_;
|
||||
}
|
||||
|
||||
std::string errorStr() const noexcept
|
||||
{
|
||||
return Utilities::errorCodeToString( errorCode_ );
|
||||
}
|
||||
|
||||
const std::string &context() const noexcept
|
||||
{
|
||||
return context_;
|
||||
}
|
||||
|
||||
// For debugging purposes:
|
||||
const char *sourceFileName() const;
|
||||
const char *sourceFunctionName() const;
|
||||
int sourceLineNumber() const;
|
||||
const char *sourceFileName() const noexcept
|
||||
{
|
||||
return sourceFileName_.c_str();
|
||||
}
|
||||
|
||||
//! \cond documentNonPublic The following isn't part of the API, and isn't
|
||||
//! documented.
|
||||
const char *sourceFunctionName() const noexcept
|
||||
{
|
||||
return sourceFunctionName_;
|
||||
}
|
||||
|
||||
int sourceLineNumber() const noexcept
|
||||
{
|
||||
return sourceLineNumber_;
|
||||
}
|
||||
|
||||
/// @cond documentNonPublic The following isn't part of the API, and isn't documented.
|
||||
E57Exception() = delete;
|
||||
E57Exception( ErrorCode ecode, const std::string &context, const std::string &srcFileName = nullptr,
|
||||
int srcLineNumber = 0, const char *srcFunctionName = nullptr );
|
||||
~E57Exception() noexcept override = default;
|
||||
E57Exception( ErrorCode ecode, std::string context, const char *srcFileName = nullptr,
|
||||
int srcLineNumber = 0, const char *srcFunctionName = nullptr ) :
|
||||
errorCode_( ecode ), context_( std::move( context ) ), sourceFileName_( srcFileName ),
|
||||
sourceFunctionName_( srcFunctionName ), sourceLineNumber_( srcLineNumber )
|
||||
{
|
||||
}
|
||||
/// @endcond
|
||||
|
||||
protected:
|
||||
private:
|
||||
/// @cond documentNonPublic The following isn't part of the API, and isn't documented.
|
||||
ErrorCode errorCode_;
|
||||
std::string context_;
|
||||
std::string sourceFileName_;
|
||||
const char *sourceFunctionName_;
|
||||
int sourceLineNumber_;
|
||||
//! \endcond
|
||||
/// @endcond
|
||||
};
|
||||
|
||||
namespace Utilities
|
||||
{
|
||||
// Get latest version of ASTM standard supported, and library id string
|
||||
E57_DLL void getVersions( int &astmMajor, int &astmMinor, std::string &libraryId );
|
||||
|
||||
E57_DLL std::string errorCodeToString( ErrorCode ecode );
|
||||
}
|
||||
}
|
||||
|
||||
+790
-697
File diff suppressed because it is too large
Load Diff
+701
-355
File diff suppressed because it is too large
Load Diff
+128
-100
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2010 Stan Coleby (scoleby@intelisum.com)
|
||||
* Copyright (c) 2020 PTC Inc.
|
||||
* Copyright (c) 2022 Andy Maloney <asmaloney@gmail.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person or organization
|
||||
* obtaining a copy of the software and accompanying documentation covered by
|
||||
@@ -29,158 +30,185 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
//! @file E57SimpleReader.h E57 Simple API for reading E57
|
||||
/// @file
|
||||
/// @brief E57 Simple API for reading E57.
|
||||
/// @details This includes support for the
|
||||
/// [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension.
|
||||
|
||||
#include "E57SimpleData.h"
|
||||
|
||||
namespace e57
|
||||
{
|
||||
/// Options to the Reader constructor
|
||||
struct E57_DLL ReaderOptions
|
||||
{
|
||||
/// Set how frequently to verify the checksums (see ReadChecksumPolicy).
|
||||
ReadChecksumPolicy checksumPolicy = ChecksumAll;
|
||||
};
|
||||
|
||||
//! @brief Used for reading of the E57 file with E57 Simple API
|
||||
/// @brief Used for reading an E57 file using E57 Simple API.
|
||||
///
|
||||
/// The Reader includes support for the
|
||||
/// [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension.
|
||||
class E57_DLL Reader
|
||||
{
|
||||
public:
|
||||
//! @brief This function is the constructor for the reader class
|
||||
//! @param [in] filePath file path to E57 file
|
||||
Reader( const ustring &filePath );
|
||||
//! @brief This function returns true if the file is open
|
||||
/// @brief Reader constructor
|
||||
/// @param [in] filePath Path to E57 file
|
||||
/// @param [in] options Options to be used for the file
|
||||
Reader( const ustring &filePath, const ReaderOptions &options );
|
||||
|
||||
/// @brief Reader constructor (deprecated)
|
||||
/// @param [in] filePath Path to E57 file
|
||||
/// @deprecated Will be removed in 4.0. Use Reader( const ustring &, const ReaderOptions & )
|
||||
/// instead.
|
||||
[[deprecated( "Will be removed in 4.0. Use Reader( const ustring, const ReaderOptions & "
|
||||
")." )]] // TODO Remove in 4.0
|
||||
explicit Reader( const ustring &filePath );
|
||||
|
||||
/// @brief Returns true if the file is open
|
||||
bool IsOpen() const;
|
||||
|
||||
//! @brief This function closes the file
|
||||
/// @brief Closes the file
|
||||
bool Close();
|
||||
|
||||
//! @name File information
|
||||
//!@{
|
||||
/// @name File information
|
||||
///@{
|
||||
|
||||
//! @brief This function returns the file header information
|
||||
//! @param [out] fileHeader is the main header information
|
||||
//! @return Returns true if successful
|
||||
/// @brief Returns the file header information
|
||||
/// @param [out] fileHeader is the main header information
|
||||
/// @return Returns true if successful
|
||||
bool GetE57Root( E57Root &fileHeader ) const;
|
||||
|
||||
//!@}
|
||||
///@}
|
||||
|
||||
//! @name Image2D
|
||||
//!@{
|
||||
/// @name Image2D
|
||||
///@{
|
||||
|
||||
//! @brief This function returns the total number of Picture Blocks
|
||||
//! @return Returns the number of Image2D blocks
|
||||
/// @brief Returns the total number of Picture Blocks
|
||||
/// @return Returns the number of Image2D blocks
|
||||
int64_t GetImage2DCount() const;
|
||||
|
||||
//! @brief This function returns the image2D header and positions the cursor
|
||||
//! @param [in] imageIndex This in the index into the image2D vector
|
||||
//! @param [out] image2DHeader pointer to the Image2D structure to receive the picture information
|
||||
//! @return Returns true if successful
|
||||
/// @brief Returns the image2D header and positions the cursor
|
||||
/// @param [in] imageIndex This in the index into the image2D vector
|
||||
/// @param [out] image2DHeader pointer to the Image2D structure to receive the picture
|
||||
/// information
|
||||
/// @return Returns true if successful
|
||||
bool ReadImage2D( int64_t imageIndex, Image2D &image2DHeader ) const;
|
||||
|
||||
//! @brief This function returns the size of the image data
|
||||
//! @param [in] imageIndex This in the index into the image2D vector
|
||||
//! @param [out] imageProjection identifies the projection in the image2D.
|
||||
//! @param [out] imageType identifies the image format of the projection.
|
||||
//! @param [out] imageWidth The image width (in pixels).
|
||||
//! @param [out] imageHeight The image height (in pixels).
|
||||
//! @param [out] imageSize This is the total number of bytes for the image blob.
|
||||
//! @param [out] imageMaskType This is E57_PNG_IMAGE_MASK if "imageMask" is defined in the projection
|
||||
//! @param [out] imageVisualType This is image type of the VisualReferenceRepresentation if given.
|
||||
//! @return Returns true if successful
|
||||
bool GetImage2DSizes( int64_t imageIndex, Image2DProjection &imageProjection, Image2DType &imageType,
|
||||
int64_t &imageWidth, int64_t &imageHeight, int64_t &imageSize, Image2DType &imageMaskType,
|
||||
/// @brief Returns the size of the image data
|
||||
/// @param [in] imageIndex This in the index into the image2D vector
|
||||
/// @param [out] imageProjection identifies the projection in the image2D.
|
||||
/// @param [out] imageType identifies the image format of the projection.
|
||||
/// @param [out] imageWidth The image width (in pixels).
|
||||
/// @param [out] imageHeight The image height (in pixels).
|
||||
/// @param [out] imageSize This is the total number of bytes for the image blob.
|
||||
/// @param [out] imageMaskType This is E57_PNG_IMAGE_MASK if "imageMask" is defined in the
|
||||
/// projection
|
||||
/// @param [out] imageVisualType This is image type of the VisualReferenceRepresentation if
|
||||
/// given.
|
||||
/// @return Returns true if successful
|
||||
bool GetImage2DSizes( int64_t imageIndex, Image2DProjection &imageProjection,
|
||||
Image2DType &imageType, int64_t &imageWidth, int64_t &imageHeight,
|
||||
int64_t &imageSize, Image2DType &imageMaskType,
|
||||
Image2DType &imageVisualType ) const;
|
||||
|
||||
//! @brief This function reads an image
|
||||
//! @param [in] imageIndex index of the image. Must be less than GetImage2DCount()
|
||||
//! @param [in] imageProjection identifies the projection desired.
|
||||
//! @param [in] imageType identifies the image format desired.
|
||||
//! @param [out] buffer pointer the raw image buffer
|
||||
//! @param [in] start position in the block to start reading
|
||||
//! @param [in] count size of desired chuck or buffer size
|
||||
//! @return Returns the number of bytes transferred.
|
||||
int64_t ReadImage2DData( int64_t imageIndex, Image2DProjection imageProjection, Image2DType imageType,
|
||||
void *buffer, int64_t start, int64_t count ) const;
|
||||
/// @brief Reads an image
|
||||
/// @param [in] imageIndex index of the image. Must be less than GetImage2DCount()
|
||||
/// @param [in] imageProjection identifies the projection desired.
|
||||
/// @param [in] imageType identifies the image format desired.
|
||||
/// @param [out] buffer pointer the raw image buffer
|
||||
/// @param [in] start position in the block to start reading
|
||||
/// @param [in] count size of desired chuck or buffer size
|
||||
/// @return Returns the number of bytes transferred.
|
||||
int64_t ReadImage2DData( int64_t imageIndex, Image2DProjection imageProjection,
|
||||
Image2DType imageType, void *buffer, int64_t start,
|
||||
int64_t count ) const;
|
||||
|
||||
//!@}
|
||||
///@}
|
||||
|
||||
//! @name Data3D
|
||||
//!@{
|
||||
/// @name Data3D
|
||||
///@{
|
||||
|
||||
//! @brief This function returns the total number of Data3D Blocks
|
||||
//! @return Returns number of Data3D blocks.
|
||||
/// @brief Returns the total number of Data3D Blocks
|
||||
/// @return Returns number of Data3D blocks.
|
||||
int64_t GetData3DCount() const;
|
||||
|
||||
//! @brief This function returns the Data3D header
|
||||
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
|
||||
//! @param [out] data3DHeader Data3D header
|
||||
//! @return Returns true if successful
|
||||
/// @brief Returns the Data3D header
|
||||
/// @param [in] dataIndex This in the index into the images3D vector. Must be less than
|
||||
/// GetData3DCount().
|
||||
/// @param [out] data3DHeader Data3D header
|
||||
/// @return Returns true if successful
|
||||
bool ReadData3D( int64_t dataIndex, Data3D &data3DHeader ) const;
|
||||
|
||||
//! @brief This function returns the size of the point data
|
||||
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
|
||||
//! @param [out] rowMax This is the maximum row size
|
||||
//! @param [out] columnMax This is the maximum column size
|
||||
//! @param [out] pointsSize This is the total number of point records
|
||||
//! @param [out] groupsSize This is the total number of group reocrds
|
||||
//! @param [out] countSize This is the maximum point count per group
|
||||
//! @param [out] columnIndex This indicates that the idElementName is "columnIndex"
|
||||
//! @return Return true if successful, false otherwise
|
||||
bool GetData3DSizes( int64_t dataIndex, int64_t &rowMax, int64_t &columnMax, int64_t &pointsSize,
|
||||
int64_t &groupsSize, int64_t &countSize, bool &columnIndex ) const;
|
||||
/// @brief Returns the size of the point data
|
||||
/// @param [in] dataIndex This in the index into the images3D vector. Must be less than
|
||||
/// GetData3DCount().
|
||||
/// @param [out] rowMax This is the maximum row size
|
||||
/// @param [out] columnMax This is the maximum column size
|
||||
/// @param [out] pointsSize This is the total number of point records
|
||||
/// @param [out] groupsSize This is the total number of group records
|
||||
/// @param [out] countSize This is the maximum point count per group
|
||||
/// @param [out] columnIndex This indicates that the idElementName is "columnIndex"
|
||||
/// @return Return true if successful, false otherwise
|
||||
bool GetData3DSizes( int64_t dataIndex, int64_t &rowMax, int64_t &columnMax,
|
||||
int64_t &pointsSize, int64_t &groupsSize, int64_t &countSize,
|
||||
bool &columnIndex ) const;
|
||||
|
||||
//! @brief This function reads the group data into the provided buffers.
|
||||
//! @param [in] dataIndex This in the index into the images3D vector. Must be less than GetData3DCount().
|
||||
//! @param [in] groupCount size of each of the buffers given
|
||||
//! @param [out] idElementValue pointer to the buffer holding indices index for this group
|
||||
//! @param [out] startPointIndex pointer to the buffer holding Starting index in to the "points" data vector for
|
||||
//! the groups
|
||||
//! @param [out] pointCount pointer to the buffer holding size of the groups given
|
||||
//! @return Return true if successful, false otherwise
|
||||
bool ReadData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue,
|
||||
/// @brief Reads the group data into the provided buffers.
|
||||
/// @param [in] dataIndex This in the index into the images3D vector. Must be less than
|
||||
/// GetData3DCount().
|
||||
/// @param [in] groupCount size of each of the buffers given
|
||||
/// @param [out] idElementValue pointer to the buffer holding indices index for this group
|
||||
/// @param [out] startPointIndex pointer to the buffer holding Starting index in to the
|
||||
/// "points" data vector for the groups
|
||||
/// @param [out] pointCount pointer to the buffer holding size of the groups given
|
||||
/// @return Return true if successful, false otherwise
|
||||
bool ReadData3DGroupsData( int64_t dataIndex, size_t groupCount, int64_t *idElementValue,
|
||||
int64_t *startPointIndex, int64_t *pointCount ) const;
|
||||
|
||||
//! @brief Use this function to read the actual 3D data
|
||||
//! @details All the non-NULL buffers in buffers have number of elements = pointCount.
|
||||
//! Call the CompressedVectorReader::read() until all data is read.
|
||||
//! @param [in] dataIndex data block index given by the NewData3D
|
||||
//! @param [in] pointCount size of each element buffer.
|
||||
//! @param [in] buffers pointers to user-provided buffers
|
||||
//! @return vector reader setup to read the selected data into the provided buffers
|
||||
/// @brief Use this to read the actual 3D data
|
||||
/// @details All the non-NULL buffers in buffers have number of elements = pointCount.
|
||||
/// Call the CompressedVectorReader::read() until all data is read.
|
||||
/// @param [in] dataIndex data block index
|
||||
/// @param [in] pointCount size of each element buffer.
|
||||
/// @param [in] buffers pointers to user-provided buffers
|
||||
/// @return vector reader setup to read the selected data into the provided buffers
|
||||
CompressedVectorReader SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
|
||||
const Data3DPointsData &buffers ) const;
|
||||
const Data3DPointsFloat &buffers ) const;
|
||||
|
||||
//! @brief Use this function to read the actual 3D data
|
||||
//! @details All the non-NULL buffers in buffers have number of elements = pointCount.
|
||||
//! Call the CompressedVectorReader::read() until all data is read.
|
||||
//! @param [in] dataIndex data block index given by the NewData3D
|
||||
//! @param [in] pointCount size of each element buffer.
|
||||
//! @param [in] buffers pointers to user-provided buffers
|
||||
//! @return vector reader setup to read the selected data into the provided buffers
|
||||
/// @overload
|
||||
CompressedVectorReader SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
|
||||
const Data3DPointsData_d &buffers ) const;
|
||||
const Data3DPointsDouble &buffers ) const;
|
||||
|
||||
//!@}
|
||||
///@}
|
||||
|
||||
//! @name Foundation API file information
|
||||
//!@{
|
||||
/// @name File information
|
||||
///@{
|
||||
|
||||
//! @brief Returns the file raw E57Root Structure Node
|
||||
/// @brief Returns the file raw E57Root Structure Node
|
||||
StructureNode GetRawE57Root() const;
|
||||
|
||||
//! @brief Returns the raw Data3D Vector Node
|
||||
/// @brief Returns the raw Data3D Vector Node
|
||||
VectorNode GetRawData3D() const;
|
||||
|
||||
//! @brief Returns the raw Image2D Vector Node
|
||||
/// @brief Returns the raw Image2D Vector Node
|
||||
VectorNode GetRawImages2D() const;
|
||||
|
||||
//! @brief Returns the ram ImageFile Node which is need to add enhancements
|
||||
/// @brief Returns the ram ImageFile Node which is need to add enhancements
|
||||
ImageFile GetRawIMF() const;
|
||||
|
||||
//!@}
|
||||
///@}
|
||||
|
||||
//! @cond documentNonPublic The following isn't part of the API, and isn't
|
||||
//! documented.
|
||||
/// @cond documentNonPublic The following isn't part of the API, and isn't documented.
|
||||
protected:
|
||||
friend class ReaderImpl;
|
||||
|
||||
E57_OBJECT_IMPLEMENTATION( Reader ) // Internal implementation details, not part of API, must be last in object
|
||||
//! @endcond
|
||||
E57_INTERNAL_ACCESS( Reader )
|
||||
|
||||
protected:
|
||||
std::shared_ptr<ReaderImpl> impl_;
|
||||
/// @endcond
|
||||
}; // end Reader class
|
||||
|
||||
} // end namespace e57
|
||||
|
||||
+117
-64
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2010 Stan Coleby (scoleby@intelisum.com)
|
||||
* Copyright (c) 2020 PTC Inc.
|
||||
* Copyright (c) 2022 Andy Maloney <asmaloney@gmail.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person or organization
|
||||
* obtaining a copy of the software and accompanying documentation covered by
|
||||
@@ -29,109 +30,161 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
//! @file E57SimpleWriter.h E57 Simple API for writing E57
|
||||
/// @file
|
||||
/// @brief E57 Simple API for writing E57.
|
||||
/// @details This includes support for the
|
||||
/// [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension.
|
||||
|
||||
#include "E57SimpleData.h"
|
||||
|
||||
namespace e57
|
||||
{
|
||||
/// Options to the Writer constructor
|
||||
struct E57_DLL WriterOptions
|
||||
{
|
||||
/// Optional file guid
|
||||
ustring guid;
|
||||
|
||||
//! @brief Used for writing of the E57 file with E57 Simple API
|
||||
/// Information describing the Coordinate Reference System to be used for the file
|
||||
ustring coordinateMetadata;
|
||||
};
|
||||
|
||||
/// @brief Used for writing an E57 file using the E57 Simple API.
|
||||
///
|
||||
/// The Writer includes support for the
|
||||
/// [E57_EXT_surface_normals](http://www.libe57.org/E57_EXT_surface_normals.txt) extension.
|
||||
class E57_DLL Writer
|
||||
{
|
||||
public:
|
||||
//! @brief This function is the constructor for the writer class
|
||||
//! @param [in] filePath file path to E57 file
|
||||
//! @param [in] coordinateMetaData Information describing the Coordinate Reference System to be used for the file
|
||||
Writer( const ustring &filePath, const ustring &coordinateMetaData = {} );
|
||||
/// @brief Writer constructor
|
||||
/// @param [in] filePath Path to E57 file
|
||||
/// @param [in] options Options to be used for the file
|
||||
Writer( const ustring &filePath, const WriterOptions &options );
|
||||
|
||||
//! @brief This function returns true if the file is open
|
||||
/// @brief Writer constructor (deprecated)
|
||||
/// @param [in] filePath Path to E57 file
|
||||
/// @param [in] coordinateMetadata Information describing the Coordinate Reference System to
|
||||
/// be used for the file
|
||||
/// @deprecated Will be removed in 4.0. Use Writer( const ustring &filePath, const
|
||||
/// WriterOptions &options ) instead.
|
||||
[[deprecated(
|
||||
"Will be removed in 4.0. Use Writer( ustring, WriterOptions )." )]] // TODO Remove in 4.0
|
||||
explicit Writer( const ustring &filePath, const ustring &coordinateMetadata = {} );
|
||||
|
||||
/// @brief Returns true if the file is open
|
||||
bool IsOpen() const;
|
||||
|
||||
//! @brief This function closes the file
|
||||
/// @brief Closes the file
|
||||
bool Close();
|
||||
|
||||
//! @name Image2D
|
||||
//!@{
|
||||
/// @name Image2D
|
||||
///@{
|
||||
|
||||
//! @brief This function writes a new Image2D header
|
||||
//! @details The user needs to config a Image2D structure with all the camera information before making this call.
|
||||
//! @param [in,out] image2DHeader header metadata
|
||||
//! @return Returns the image2D index
|
||||
/// @brief This function writes the Image2D data to the file
|
||||
/// @note @p image2DHeader may be modified (adding a guid or adding missing, required fields).
|
||||
/// @param [in,out] image2DHeader header metadata
|
||||
/// @param [in] imageType identifies the image format
|
||||
/// @param [in] imageProjection identifies the projection
|
||||
/// @param [in] startPos position in the block to start writing
|
||||
/// @param [in] buffer pointer the data buffer
|
||||
/// @param [in] byteCount buffer size
|
||||
/// @return Returns the number of bytes written
|
||||
int64_t WriteImage2DData( Image2D &image2DHeader, Image2DType imageType,
|
||||
Image2DProjection imageProjection, int64_t startPos, void *buffer,
|
||||
int64_t byteCount );
|
||||
|
||||
/// @brief Writes a new Image2D header
|
||||
/// @details The user needs to config a Image2D structure with all the camera information
|
||||
/// before making this call.
|
||||
/// @param [in,out] image2DHeader header metadata
|
||||
/// @return Returns the image2D index
|
||||
int64_t NewImage2D( Image2D &image2DHeader );
|
||||
|
||||
//! @brief This function writes the actual image data
|
||||
//! @param [in] imageIndex picture block index given by the NewImage2D
|
||||
//! @param [in] imageType identifies the image format desired.
|
||||
//! @param [in] imageProjection identifies the projection desired.
|
||||
//! @param [in] buffer pointer the buffer
|
||||
//! @param [in] start position in the block to start writing
|
||||
//! @param [in] count size of desired chuck or buffer size
|
||||
//! @return Returns the number of bytes written
|
||||
int64_t WriteImage2DData( int64_t imageIndex, Image2DType imageType, Image2DProjection imageProjection,
|
||||
void *buffer, int64_t start, int64_t count );
|
||||
/// @brief Writes the actual image data
|
||||
/// @param [in] imageIndex picture block index given by the NewImage2D
|
||||
/// @param [in] imageType identifies the image format desired.
|
||||
/// @param [in] imageProjection identifies the projection desired.
|
||||
/// @param [in] buffer pointer the buffer
|
||||
/// @param [in] start position in the block to start writing
|
||||
/// @param [in] count size of desired chunk or buffer size
|
||||
/// @return Returns the number of bytes written
|
||||
int64_t WriteImage2DData( int64_t imageIndex, Image2DType imageType,
|
||||
Image2DProjection imageProjection, void *buffer, int64_t start,
|
||||
int64_t count );
|
||||
|
||||
//!@}
|
||||
///@}
|
||||
|
||||
//! @name Data3D
|
||||
//!@{
|
||||
/// @name Data3D
|
||||
///@{
|
||||
|
||||
//! @brief This function writes new Data3D header
|
||||
//! @details The user needs to config a Data3D structure with all the scanning information before making this
|
||||
//! call.
|
||||
//! @param [in,out] data3DHeader scan metadata
|
||||
//! @return Returns the index of the new scan's data3D block.
|
||||
/// @brief This function writes the Data3D data to the file
|
||||
/// @details The user needs to config a Data3D structure with all the scanning information
|
||||
/// before making this call.
|
||||
/// @note @p data3DHeader may be modified (adding a guid or adding missing, required fields).
|
||||
/// @param [in,out] data3DHeader metadata about what is included in the buffers
|
||||
/// @param [in] buffers pointers to user-provided buffers containing the actual data
|
||||
/// @return Returns the index of the new scan's data3D block.
|
||||
int64_t WriteData3DData( Data3D &data3DHeader, const Data3DPointsFloat &buffers );
|
||||
|
||||
/// @overload
|
||||
int64_t WriteData3DData( Data3D &data3DHeader, const Data3DPointsDouble &buffers );
|
||||
|
||||
/// @brief Writes a new Data3D header
|
||||
/// @details The user needs to config a Data3D structure with all the scanning information
|
||||
/// before making this call.
|
||||
/// @param [in,out] data3DHeader scan metadata
|
||||
/// @return Returns the index of the new scan's data3D block.
|
||||
int64_t NewData3D( Data3D &data3DHeader );
|
||||
|
||||
//! @brief This function setups a writer to write the actual scan data
|
||||
//! @param [in] dataIndex index returned by NewData3D
|
||||
//! @param [in] pointCount Number of points to write (number of elements in each of the buffers)
|
||||
//! @param [in] buffers pointers to user-provided buffers
|
||||
//! @return returns a vector writer setup to write the selected scan data
|
||||
/// @brief Sets up a writer to write the actual scan data
|
||||
/// @param [in] dataIndex index returned by NewData3D
|
||||
/// @param [in] pointCount Number of points to write (number of elements in each of the
|
||||
/// buffers)
|
||||
/// @param [in] buffers pointers to user-provided buffers
|
||||
/// @return returns a vector writer setup to write the selected scan data
|
||||
CompressedVectorWriter SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
|
||||
const Data3DPointsData &buffers );
|
||||
const Data3DPointsFloat &buffers );
|
||||
|
||||
//! @brief This function setups a writer to write the actual scan data
|
||||
//! @param [in] dataIndex index returned by NewData3D
|
||||
//! @param [in] pointCount Number of points to write (number of elements in each of the buffers)
|
||||
//! @param [in] buffers pointers to user-provided buffers
|
||||
//! @return returns a vector writer setup to write the selected scan data
|
||||
/// @overload
|
||||
CompressedVectorWriter SetUpData3DPointsData( int64_t dataIndex, size_t pointCount,
|
||||
const Data3DPointsData_d &buffers );
|
||||
const Data3DPointsDouble &buffers );
|
||||
|
||||
//! @brief This function writes out the group data
|
||||
//! @param [in] dataIndex data block index given by the NewData3D
|
||||
//! @param [in] groupCount size of each of the buffers given
|
||||
//! @param [in] buffer of idElementValue index for this group
|
||||
//! @param [in] startPointIndex buffer with starting indices in to the "points" data vector for the groups
|
||||
//! @param [in] pointCount buffer with sizes of the groups given
|
||||
//! @return Return true if successful, false otherwise
|
||||
bool WriteData3DGroupsData( int64_t dataIndex, int64_t groupCount, int64_t *idElementValue,
|
||||
/// @brief Writes out the group data
|
||||
/// @param [in] dataIndex data block index given by the NewData3D
|
||||
/// @param [in] groupCount size of each of the buffers given
|
||||
/// @param [in] idElementValue buffer with idElementValue indices for this group
|
||||
/// @param [in] startPointIndex buffer with starting indices in to the "points" data vector
|
||||
/// for the groups
|
||||
/// @param [in] pointCount buffer with sizes of the groups given
|
||||
/// @return Return true if successful, false otherwise
|
||||
bool WriteData3DGroupsData( int64_t dataIndex, size_t groupCount, int64_t *idElementValue,
|
||||
int64_t *startPointIndex, int64_t *pointCount );
|
||||
|
||||
//!@}
|
||||
///@}
|
||||
|
||||
//! @name Foundation API file information
|
||||
//!@{
|
||||
/// @name File information
|
||||
///@{
|
||||
|
||||
//! @brief This function returns the file raw E57Root Structure Node
|
||||
/// @brief Returns the file raw E57Root Structure Node
|
||||
StructureNode GetRawE57Root();
|
||||
//! @brief This function returns the raw Data3D Vector Node
|
||||
/// @brief Returns the raw Data3D Vector Node
|
||||
VectorNode GetRawData3D();
|
||||
//! @brief This function returns the raw Image2D Vector Node
|
||||
/// @brief Returns the raw Image2D Vector Node
|
||||
VectorNode GetRawImages2D();
|
||||
//! @brief This function returns the ram ImageFile Node which is need to add enhancements
|
||||
/// @brief Returns the ram ImageFile Node which is need to add enhancements
|
||||
ImageFile GetRawIMF();
|
||||
|
||||
//!@}
|
||||
///@}
|
||||
|
||||
//! @cond documentNonPublic The following isn't part of the API, and isn't
|
||||
//! documented.
|
||||
/// @cond documentNonPublic The following isn't part of the API, and isn't documented.
|
||||
protected:
|
||||
friend class WriterImpl;
|
||||
|
||||
E57_OBJECT_IMPLEMENTATION( Writer ) // Internal implementation details, not part of API, must be last in object
|
||||
//! @endcond
|
||||
E57_INTERNAL_ACCESS( Writer )
|
||||
|
||||
protected:
|
||||
std::shared_ptr<WriterImpl> impl_;
|
||||
/// @endcond
|
||||
}; // end Writer class
|
||||
|
||||
} // end namespace e57
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
#pragma once
|
||||
// Copyright © 2022 Andy Maloney <asmaloney@gmail.com>
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
/// @file E57Version.h ASTM & libE57Format version information.
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "E57Export.h"
|
||||
|
||||
namespace e57
|
||||
{
|
||||
namespace Version
|
||||
{
|
||||
/*!
|
||||
@brief Get the version of the ASTM E57 standard that libE57Format supports.
|
||||
|
||||
@returns The version as a string (e.g. "1.0")
|
||||
*/
|
||||
E57_DLL std::string astm();
|
||||
|
||||
/*!
|
||||
@brief Get the major version of the ASTM E57 standard that libE57Format supports.
|
||||
|
||||
@returns The major version
|
||||
*/
|
||||
E57_DLL uint32_t astmMajor();
|
||||
|
||||
/*!
|
||||
@brief Get the minor version of the ASTM E57 standard that libE57Format supports.
|
||||
|
||||
@returns The minor version
|
||||
*/
|
||||
E57_DLL uint32_t astmMinor();
|
||||
|
||||
/*!
|
||||
@brief Get the version of libE57Format library.
|
||||
|
||||
@returns The version as a string (e.g. "E57Format-3.0.0-x86_64-darwin-AppleClang140").
|
||||
*/
|
||||
E57_DLL std::string library();
|
||||
|
||||
/*!
|
||||
@brief Get the version of ASTM E57 standard that the API implementation supports, and library
|
||||
id string.
|
||||
|
||||
@param [out] astmMajor The major version number of the ASTM E57 standard supported.
|
||||
@param [out] astmMinor The minor version number of the ASTM E57 standard supported.
|
||||
@param [out] libraryId A string identifying the implementation of the API.
|
||||
|
||||
@details
|
||||
Since the E57 implementation may be dynamically linked underneath the API, the version string
|
||||
for the implementation and the ASTM version that it supports can't be determined at
|
||||
compile-time. This function returns these identifiers from the underlying implementation.
|
||||
|
||||
@throw No E57Exceptions.
|
||||
*/
|
||||
E57_DLL void get( uint32_t &astmMajor, uint32_t &astmMinor, std::string &libraryId );
|
||||
}
|
||||
|
||||
namespace Utilities
|
||||
{
|
||||
/*!
|
||||
@copydetails Version::get()
|
||||
@deprecated Will be removed in 4.0. Use Version::get() or other functions in the Version
|
||||
namespace.
|
||||
*/
|
||||
[[deprecated( "Will be removed in 4.0. Use Version::get() or other functions in the Version "
|
||||
"namespace." )]] E57_DLL void
|
||||
getVersions( int &astmMajor, int &astmMinor, std::string &libraryId );
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
// Copyright © 2022 Andy Maloney <asmaloney@gmail.com>
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace e57
|
||||
{
|
||||
/// The file format major version number. The value shall be 1.
|
||||
/// @remark E57 Standard Table 1 - Format of the E57 File Header Section
|
||||
constexpr uint32_t E57_FORMAT_MAJOR = 1;
|
||||
|
||||
/// The file format minor version number. The value shall be 0.
|
||||
/// @remark E57 Standard Table 1 - Format of the E57 File Header Section
|
||||
constexpr uint32_t E57_FORMAT_MINOR = 0;
|
||||
}
|
||||
+367
@@ -0,0 +1,367 @@
|
||||
/*
|
||||
* BlobNode.cpp - implementation of public functions of the BlobNode class.
|
||||
*
|
||||
* Original work Copyright 2009 - 2010 Kevin Ackley (kackley@gwi.net)
|
||||
* Modified work Copyright 2018 - 2020 Andy Maloney <asmaloney@gmail.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/// @file BlobNode.cpp
|
||||
|
||||
#include "BlobNodeImpl.h"
|
||||
#include "StringFunctions.h"
|
||||
|
||||
using namespace e57;
|
||||
|
||||
// Put this function first so we can reference the code in doxygen using @skip
|
||||
/*!
|
||||
@brief Check whether BlobNode class invariant is true
|
||||
@copydetails IntegerNode::checkInvariant()
|
||||
*/
|
||||
void BlobNode::checkInvariant( bool /*doRecurse*/, bool doUpcast ) const
|
||||
{
|
||||
// If destImageFile not open, can't test invariant (almost every call would throw)
|
||||
if ( !destImageFile().isOpen() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If requested, call Node::checkInvariant
|
||||
if ( doUpcast )
|
||||
{
|
||||
static_cast<Node>( *this ).checkInvariant( false, false );
|
||||
}
|
||||
|
||||
if ( byteCount() < 0 )
|
||||
{
|
||||
throw E57_EXCEPTION1( ErrorInvarianceViolation );
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@class e57::BlobNode
|
||||
|
||||
@brief An E57 element encoding an fixed-length sequence of bytes with an opaque format.
|
||||
|
||||
@details
|
||||
A BlobNode is a terminal node (i.e. having no children) that holds an opaque, fixed-length sequence
|
||||
of bytes. The number of bytes in the BlobNode is declared at creation time. The content of the blob
|
||||
is stored within the E57 file in an efficient binary format (but not compressed). The BlobNode
|
||||
cannot grow after it is created. There is no ordering constraints on how content of a BlobNode may
|
||||
be accessed (i.e. it is random access). BlobNodes in an ImageFile opened for reading are read-only.
|
||||
|
||||
There are two categories of BlobNodes, distinguished by their usage: private BlobNodes and public
|
||||
BlobNodes. In a private BlobNode, the format of its content bytes is not published. This is useful
|
||||
for storing proprietary data that a writer does not wish to share with all readers. Rather than put
|
||||
this information in a separate file, the writer can embed the file inside the E57 file so it cannot
|
||||
be lost.
|
||||
|
||||
In a public BlobNode, the format is published or follows some industry standard format (e.g. JPEG).
|
||||
Rather than reinvent the wheel in applications that are already well-served by an existing format
|
||||
standard, an E57 file writer can just embed an existing file as an "attachment" in a BlobNode. The
|
||||
internal format of a public BlobNode is not enforced by the Foundation API. It is recommended that
|
||||
there be some mechanism for a reader to know ahead of time which format the BlobNode content adheres
|
||||
to (either specified by a document, or encoded by some scheme in the E57 Element tree).
|
||||
|
||||
The BlobNode is the one node type where the set-once policy is not strictly enforced. It is possible
|
||||
to write the same byte location in a BlobNode several times. However it is not recommended.
|
||||
|
||||
See Node class discussion for discussion of the common functions that StructureNode supports.
|
||||
|
||||
@section BlobNode_invariant Class Invariant
|
||||
A class invariant is a list of statements about an object that are always true before and after any
|
||||
operation on the object. An invariant is useful for testing correct operation of an implementation.
|
||||
Statements in an invariant can involve only externally visible state, or, can refer to internal
|
||||
implementation-specific state that is not visible to the API user. The following C++ code checks
|
||||
externally visible state for consistency and throws an exception if the invariant is violated:
|
||||
|
||||
@dontinclude BlobNode.cpp
|
||||
@skip void BlobNode::checkInvariant
|
||||
@until ^}
|
||||
|
||||
@see Node
|
||||
*/
|
||||
|
||||
/*!
|
||||
@brief Create an element for storing a sequence of bytes with an opaque format.
|
||||
@param [in] destImageFile The ImageFile where the new node will eventually be stored.
|
||||
@param [in] byteCount The number of bytes reserved in the ImageFile for holding the blob.
|
||||
@details
|
||||
The BlobNode class corresponds to the ASTM E57 standard Blob element.
|
||||
|
||||
See the class discussion at bottom of BlobNode page for more details.
|
||||
|
||||
The E57 Foundation Implementation may pre-allocate disk space in the ImageFile to store the declared
|
||||
length of the blob. The disk must have enough free space to store @a byteCount bytes of data. The
|
||||
data of a newly created BlobNode is initialized to zero.
|
||||
|
||||
The @a destImageFile indicates which ImageFile the BlobNode will eventually be attached to. A node
|
||||
is attached to an ImageFile by adding it underneath the predefined root of the ImageFile (gotten
|
||||
from ImageFile::root). It is not an error to fail to attach the BlobNode to the @a destImageFile. It
|
||||
is an error to attempt to attach the BlobNode to a different ImageFile.
|
||||
|
||||
@pre The @a destImageFile must be open (i.e. destImageFile.isOpen() must be true).
|
||||
@pre The @a destImageFile must have been opened in write mode (i.e. destImageFile.isWritable()
|
||||
must be true).
|
||||
@pre byteCount >= 0
|
||||
|
||||
@throw ::ErrorBadAPIArgument
|
||||
@throw ::ErrorImageFileNotOpen
|
||||
@throw ::ErrorFileReadOnly
|
||||
@throw ::ErrorInternal All objects in undocumented state
|
||||
|
||||
@see Node, BlobNode::read, BlobNode::write
|
||||
*/
|
||||
BlobNode::BlobNode( const ImageFile &destImageFile, int64_t byteCount ) :
|
||||
impl_( new BlobNodeImpl( destImageFile.impl(), byteCount ) )
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Is this a root node.
|
||||
@copydetails Node::isRoot()
|
||||
*/
|
||||
bool BlobNode::isRoot() const
|
||||
{
|
||||
return impl_->isRoot();
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Return parent of node, or self if a root node.
|
||||
@copydetails Node::parent()
|
||||
*/
|
||||
Node BlobNode::parent() const
|
||||
{
|
||||
return Node( impl_->parent() );
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Get absolute pathname of node.
|
||||
@copydetails Node::pathName()
|
||||
*/
|
||||
ustring BlobNode::pathName() const
|
||||
{
|
||||
return impl_->pathName();
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Get elementName string, that identifies the node in its parent.
|
||||
@copydetails Node::elementName()
|
||||
*/
|
||||
ustring BlobNode::elementName() const
|
||||
{
|
||||
return impl_->elementName();
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Get the ImageFile that was declared as the destination for the node when it was created.
|
||||
@copydetails Node::destImageFile()
|
||||
*/
|
||||
ImageFile BlobNode::destImageFile() const
|
||||
{
|
||||
return ImageFile( impl_->destImageFile() );
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Has node been attached into the tree of an ImageFile.
|
||||
@copydetails Node::isAttached()
|
||||
*/
|
||||
bool BlobNode::isAttached() const
|
||||
{
|
||||
return impl_->isAttached();
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Get size of blob declared when it was created.
|
||||
|
||||
@pre The destination ImageFile must be open (i.e. destImageFile().isOpen()).
|
||||
@post No visible state is modified.
|
||||
|
||||
@return The declared size of the blob when it was created.
|
||||
|
||||
@throw ::ErrorImageFileNotOpen
|
||||
@throw ::ErrorInternal All objects in undocumented state
|
||||
|
||||
@see BlobNode::read, BlobNode::write
|
||||
*/
|
||||
int64_t BlobNode::byteCount() const
|
||||
{
|
||||
return impl_->byteCount();
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Read a buffer of bytes from a blob.
|
||||
|
||||
@param [in] buf A memory buffer to store bytes read from the blob.
|
||||
@param [in] start The index of the first byte in blob to read.
|
||||
@param [in] count The number of bytes to read.
|
||||
|
||||
@details
|
||||
The memory buffer @a buf must be able to store at least @a count bytes.
|
||||
|
||||
The data is stored in a binary section of the ImageFile with checksum protection, so undetected
|
||||
corruption is very unlikely. It is an error to attempt to read outside the declared size of the
|
||||
Blob. The format of the data read is opaque (unspecified by the ASTM E57 data format standard).
|
||||
Since @a buf is a byte buffer, byte ordering is irrelevant (it will come out in the same order that
|
||||
it went in). There is no constraint on the ordering of reads. Any part of the Blob data can be read
|
||||
zero or more times.
|
||||
|
||||
@pre The destination ImageFile must be open (i.e. destImageFile().isOpen()).
|
||||
@pre buf != NULL
|
||||
@pre 0 <= @a start < byteCount()
|
||||
@pre 0 <= count
|
||||
@pre (@a start + @a count) < byteCount()
|
||||
|
||||
@throw ::ErrorBadAPIArgument
|
||||
@throw ::ErrorImageFileNotOpen
|
||||
@throw ::ErrorSeekFailed
|
||||
@throw ::ErrorReadFailed
|
||||
@throw ::ErrorBadChecksum
|
||||
@throw ::ErrorInternal All objects in undocumented state
|
||||
|
||||
@see BlobNode::byteCount, BlobNode::write
|
||||
*/
|
||||
void BlobNode::read( uint8_t *buf, int64_t start, size_t count )
|
||||
{
|
||||
impl_->read( buf, start, count );
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Write a buffer of bytes to a blob.
|
||||
|
||||
@param [in] buf A memory buffer of bytes to write to the blob.
|
||||
@param [in] start The index of the first byte in blob to write to.
|
||||
@param [in] count The number of bytes to write.
|
||||
|
||||
@details
|
||||
The memory buffer @a buf must store at least @a count bytes.
|
||||
|
||||
The data is stored in a binary section of the ImageFile with checksum protection, so undetected
|
||||
corruption is very unlikely. It is an error to attempt to write outside the declared size of the
|
||||
Blob. The format of the data written is opaque (unspecified by the ASTM E57 data format standard).
|
||||
Since @a buf is a byte buffer, byte ordering is irrelevant (it will come out in the same order that
|
||||
it went in). There is no constraint on the ordering of writes. It is not an error to write a portion
|
||||
of the BlobNode data more than once, or not at all. Initially all the BlobNode data is zero, so if a
|
||||
portion is not written, it will remain zero. The BlobNode is one of the two node types that must be
|
||||
attached to the root of a write mode ImageFile before write operations can be performed (the other
|
||||
type is CompressedVectorNode).
|
||||
|
||||
@pre The destination ImageFile must be open (i.e. destImageFile().isOpen()).
|
||||
@pre The associated destImageFile must have been opened in write mode (i.e.
|
||||
destImageFile().isWritable()).
|
||||
@pre The BlobNode must be attached to an ImageFile (i.e. isAttached()).
|
||||
@pre buf != NULL
|
||||
@pre 0 <= @a start < byteCount()
|
||||
@pre 0 <= count
|
||||
@pre (@a start + @a count) < byteCount()
|
||||
|
||||
@throw ::ErrorBadAPIArgument
|
||||
@throw ::ErrorImageFileNotOpen
|
||||
@throw ::ErrorFileReadOnly
|
||||
@throw ::ErrorNodeUnattached
|
||||
@throw ::ErrorSeekFailed
|
||||
@throw ::ErrorReadFailed
|
||||
@throw ::ErrorWriteFailed
|
||||
@throw ::ErrorBadChecksum
|
||||
@throw ::ErrorInternal All objects in undocumented state
|
||||
|
||||
@see BlobNode::byteCount, BlobNode::read
|
||||
*/
|
||||
void BlobNode::write( uint8_t *buf, int64_t start, size_t count )
|
||||
{
|
||||
impl_->write( buf, start, count );
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Diagnostic function to print internal state of object to output stream in an indented format.
|
||||
@copydetails Node::dump()
|
||||
*/
|
||||
#ifdef E57_ENABLE_DIAGNOSTIC_OUTPUT
|
||||
void BlobNode::dump( int indent, std::ostream &os ) const
|
||||
{
|
||||
impl_->dump( indent, os );
|
||||
}
|
||||
#else
|
||||
void BlobNode::dump( int indent, std::ostream &os ) const
|
||||
{
|
||||
E57_UNUSED( indent );
|
||||
E57_UNUSED( os );
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@brief Upcast a BlobNode handle to a generic Node handle.
|
||||
|
||||
@details
|
||||
An upcast is always safe, and the compiler can automatically insert it for initializations of Node
|
||||
variables and Node function arguments.
|
||||
|
||||
@return A smart Node handle referencing the underlying object.
|
||||
|
||||
@throw No E57Exceptions.
|
||||
|
||||
@see Explanation in Node, Node::type(), BlobNode(const Node&)
|
||||
*/
|
||||
BlobNode::operator Node() const
|
||||
{
|
||||
// Upcast from shared_ptr<StringNodeImpl> to SharedNodeImplPtr and construct
|
||||
// a Node object
|
||||
return Node( impl_ );
|
||||
}
|
||||
|
||||
/*!
|
||||
@brief Downcast a generic Node handle to a BlobNode handle.
|
||||
|
||||
@param [in] n The generic handle to downcast.
|
||||
|
||||
@details
|
||||
The handle @a n must be for an underlying BlobNode, otherwise an exception is thrown. In designs
|
||||
that need to avoid the exception, use Node::type() to determine the actual type of the @a n before
|
||||
downcasting. This function must be explicitly called (c++ compiler cannot insert it automatically).
|
||||
|
||||
@throw ::ErrorBadNodeDowncast
|
||||
|
||||
@see Node::type(), BlobNode::operator Node()
|
||||
*/
|
||||
BlobNode::BlobNode( const Node &n )
|
||||
{
|
||||
if ( n.type() != TypeBlob )
|
||||
{
|
||||
throw E57_EXCEPTION2( ErrorBadNodeDowncast, "nodeType=" + toString( n.type() ) );
|
||||
}
|
||||
|
||||
// Set our shared_ptr to the downcast shared_ptr
|
||||
impl_ = std::static_pointer_cast<BlobNodeImpl>( n.impl() );
|
||||
}
|
||||
|
||||
/// @cond documentNonPublic The following isn't part of the API, and isn't documented.
|
||||
BlobNode::BlobNode( const ImageFile &destImageFile, int64_t fileOffset, int64_t length ) :
|
||||
impl_( new BlobNodeImpl( destImageFile.impl(), fileOffset, length ) )
|
||||
{
|
||||
}
|
||||
|
||||
BlobNode::BlobNode( std::shared_ptr<BlobNodeImpl> ni ) : impl_( ni )
|
||||
{
|
||||
}
|
||||
/// @endcond
|
||||
+43
-38
@@ -29,19 +29,21 @@
|
||||
#include "CheckedFile.h"
|
||||
#include "ImageFileImpl.h"
|
||||
#include "SectionHeaders.h"
|
||||
#include "StringFunctions.h"
|
||||
|
||||
namespace e57
|
||||
{
|
||||
BlobNodeImpl::BlobNodeImpl( ImageFileImplWeakPtr destImageFile, int64_t byteCount ) : NodeImpl( destImageFile )
|
||||
BlobNodeImpl::BlobNodeImpl( ImageFileImplWeakPtr destImageFile, int64_t byteCount ) :
|
||||
NodeImpl( destImageFile )
|
||||
{
|
||||
// don't checkImageFileOpen, NodeImpl() will do it
|
||||
|
||||
ImageFileImplSharedPtr imf( destImageFile );
|
||||
|
||||
/// This what caller thinks blob length is
|
||||
// This what caller thinks blob length is
|
||||
blobLogicalLength_ = byteCount;
|
||||
|
||||
/// Round segment length up to multiple of 4 bytes
|
||||
// Round segment length up to multiple of 4 bytes
|
||||
binarySectionLogicalLength_ = sizeof( BlobSectionHeader ) + blobLogicalLength_;
|
||||
unsigned remainder = binarySectionLogicalLength_ % 4;
|
||||
if ( remainder > 0 )
|
||||
@@ -49,32 +51,32 @@ namespace e57
|
||||
binarySectionLogicalLength_ += 4 - remainder;
|
||||
}
|
||||
|
||||
/// Reserve space for blob in file, extend with zeros since writes will
|
||||
/// happen at later time by caller
|
||||
// Reserve space for blob in file, extend with zeros since writes will
|
||||
// happen at later time by caller
|
||||
binarySectionLogicalStart_ = imf->allocateSpace( binarySectionLogicalLength_, true );
|
||||
|
||||
/// Prepare BlobSectionHeader
|
||||
// Prepare BlobSectionHeader
|
||||
BlobSectionHeader header;
|
||||
header.sectionLogicalLength = binarySectionLogicalLength_;
|
||||
#ifdef E57_MAX_VERBOSE
|
||||
#ifdef E57_VERBOSE
|
||||
header.dump(); //???
|
||||
#endif
|
||||
|
||||
/// Write header at beginning of section
|
||||
// Write header at beginning of section
|
||||
imf->file_->seek( binarySectionLogicalStart_ );
|
||||
imf->file_->write( reinterpret_cast<char *>( &header ), sizeof( header ) );
|
||||
}
|
||||
|
||||
BlobNodeImpl::BlobNodeImpl( ImageFileImplWeakPtr destImageFile, int64_t fileOffset, int64_t length ) :
|
||||
NodeImpl( destImageFile )
|
||||
BlobNodeImpl::BlobNodeImpl( ImageFileImplWeakPtr destImageFile, int64_t fileOffset,
|
||||
int64_t length ) : NodeImpl( destImageFile )
|
||||
{
|
||||
/// Init blob object that already exists in E57 file currently reading.
|
||||
// Init blob object that already exists in E57 file currently reading.
|
||||
|
||||
// don't checkImageFileOpen, NodeImpl() will do it
|
||||
|
||||
ImageFileImplSharedPtr imf( destImageFile );
|
||||
|
||||
/// Init state from values read from XML
|
||||
// Init state from values read from XML
|
||||
blobLogicalLength_ = length;
|
||||
binarySectionLogicalStart_ = imf->file_->physicalToLogical( fileOffset );
|
||||
binarySectionLogicalLength_ = sizeof( BlobSectionHeader ) + blobLogicalLength_;
|
||||
@@ -84,24 +86,24 @@ namespace e57
|
||||
{
|
||||
// don't checkImageFileOpen, NodeImpl() will do it
|
||||
|
||||
/// Same node type?
|
||||
if ( ni->type() != E57_BLOB )
|
||||
// Same node type?
|
||||
if ( ni->type() != TypeBlob )
|
||||
{
|
||||
return ( false );
|
||||
}
|
||||
|
||||
/// Downcast to shared_ptr<BlobNodeImpl>
|
||||
// Downcast to shared_ptr<BlobNodeImpl>
|
||||
std::shared_ptr<BlobNodeImpl> bi( std::static_pointer_cast<BlobNodeImpl>( ni ) );
|
||||
|
||||
/// blob lengths must match
|
||||
// blob lengths must match
|
||||
if ( blobLogicalLength_ != bi->blobLogicalLength_ )
|
||||
{
|
||||
return ( false );
|
||||
}
|
||||
|
||||
/// ignore blob contents, doesn't have to match
|
||||
// ignore blob contents, doesn't have to match
|
||||
|
||||
/// Types match
|
||||
// Types match
|
||||
return ( true );
|
||||
}
|
||||
|
||||
@@ -109,7 +111,7 @@ namespace e57
|
||||
{
|
||||
// don't checkImageFileOpen, NodeImpl() will do it
|
||||
|
||||
/// We have no sub-structure, so if path not empty return false
|
||||
// We have no sub-structure, so if path not empty return false
|
||||
return pathName.empty();
|
||||
}
|
||||
|
||||
@@ -126,9 +128,10 @@ namespace e57
|
||||
checkImageFileOpen( __FILE__, __LINE__, static_cast<const char *>( __FUNCTION__ ) );
|
||||
if ( static_cast<uint64_t>( start ) + count > blobLogicalLength_ )
|
||||
{
|
||||
throw E57_EXCEPTION2( E57_ERROR_BAD_API_ARGUMENT,
|
||||
"this->pathName=" + this->pathName() + " start=" + toString( start ) +
|
||||
" count=" + toString( count ) + " length=" + toString( blobLogicalLength_ ) );
|
||||
throw E57_EXCEPTION2( ErrorBadAPIArgument,
|
||||
"this->pathName=" + this->pathName() +
|
||||
" start=" + toString( start ) + " count=" + toString( count ) +
|
||||
" length=" + toString( blobLogicalLength_ ) );
|
||||
}
|
||||
|
||||
ImageFileImplSharedPtr imf( destImageFile_ );
|
||||
@@ -146,18 +149,19 @@ namespace e57
|
||||
|
||||
if ( !destImageFile->isWriter() )
|
||||
{
|
||||
throw E57_EXCEPTION2( E57_ERROR_FILE_IS_READ_ONLY, "fileName=" + destImageFile->fileName() );
|
||||
throw E57_EXCEPTION2( ErrorFileReadOnly, "fileName=" + destImageFile->fileName() );
|
||||
}
|
||||
if ( !isAttached() )
|
||||
{
|
||||
throw E57_EXCEPTION2( E57_ERROR_NODE_UNATTACHED, "fileName=" + destImageFile->fileName() );
|
||||
throw E57_EXCEPTION2( ErrorNodeUnattached, "fileName=" + destImageFile->fileName() );
|
||||
}
|
||||
|
||||
if ( static_cast<uint64_t>( start ) + count > blobLogicalLength_ )
|
||||
{
|
||||
throw E57_EXCEPTION2( E57_ERROR_BAD_API_ARGUMENT,
|
||||
"this->pathName=" + this->pathName() + " start=" + toString( start ) +
|
||||
" count=" + toString( count ) + " length=" + toString( blobLogicalLength_ ) );
|
||||
throw E57_EXCEPTION2( ErrorBadAPIArgument,
|
||||
"this->pathName=" + this->pathName() +
|
||||
" start=" + toString( start ) + " count=" + toString( count ) +
|
||||
" length=" + toString( blobLogicalLength_ ) );
|
||||
}
|
||||
|
||||
ImageFileImplSharedPtr imf( destImageFile_ );
|
||||
@@ -170,11 +174,11 @@ namespace e57
|
||||
{
|
||||
// don't checkImageFileOpen
|
||||
|
||||
/// We are a leaf node, so verify that we are listed in set. ???true for
|
||||
/// blobs? what exception get if try blob in compressedvector?
|
||||
// We are a leaf node, so verify that we are listed in set. ???true for
|
||||
// blobs? what exception get if try blob in compressedvector?
|
||||
if ( pathNames.find( relativePathName( origin ) ) == pathNames.end() )
|
||||
{
|
||||
throw E57_EXCEPTION2( E57_ERROR_NO_BUFFER_FOR_ELEMENT, "this->pathName=" + this->pathName() );
|
||||
throw E57_EXCEPTION2( ErrorNoBufferForElement, "this->pathName=" + this->pathName() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +188,7 @@ namespace e57
|
||||
// don't checkImageFileOpen
|
||||
|
||||
ustring fieldName;
|
||||
if ( forcedFieldName )
|
||||
if ( forcedFieldName != nullptr )
|
||||
{
|
||||
fieldName = forcedFieldName;
|
||||
}
|
||||
@@ -197,20 +201,21 @@ namespace e57
|
||||
//??? Type --> type
|
||||
//??? need to have length?, check same as in section header?
|
||||
uint64_t physicalOffset = cf.logicalToPhysical( binarySectionLogicalStart_ );
|
||||
cf << space( indent ) << "<" << fieldName << " type=\"Blob\" fileOffset=\"" << physicalOffset << "\" length=\""
|
||||
<< blobLogicalLength_ << "\"/>\n";
|
||||
cf << space( indent ) << "<" << fieldName << " type=\"Blob\" fileOffset=\"" << physicalOffset
|
||||
<< "\" length=\"" << blobLogicalLength_ << "\"/>\n";
|
||||
}
|
||||
|
||||
#ifdef E57_DEBUG
|
||||
#ifdef E57_ENABLE_DIAGNOSTIC_OUTPUT
|
||||
void BlobNodeImpl::dump( int indent, std::ostream &os ) const
|
||||
{
|
||||
// don't checkImageFileOpen
|
||||
os << space( indent ) << "type: Blob"
|
||||
<< " (" << type() << ")" << std::endl;
|
||||
os << space( indent ) << "type: Blob" << " (" << type() << ")" << std::endl;
|
||||
NodeImpl::dump( indent, os );
|
||||
os << space( indent ) << "blobLogicalLength_: " << blobLogicalLength_ << std::endl;
|
||||
os << space( indent ) << "binarySectionLogicalStart: " << binarySectionLogicalStart_ << std::endl;
|
||||
os << space( indent ) << "binarySectionLogicalLength: " << binarySectionLogicalLength_ << std::endl;
|
||||
os << space( indent ) << "binarySectionLogicalStart: " << binarySectionLogicalStart_
|
||||
<< std::endl;
|
||||
os << space( indent ) << "binarySectionLogicalLength: " << binarySectionLogicalLength_
|
||||
<< std::endl;
|
||||
// size_t i;
|
||||
// for (i = 0; i < blobLogicalLength_ && i < 10; i++) {
|
||||
// uint8_t b;
|
||||
|
||||
+3
-2
@@ -39,8 +39,9 @@ namespace e57
|
||||
|
||||
NodeType type() const override
|
||||
{
|
||||
return E57_BLOB;
|
||||
return TypeBlob;
|
||||
}
|
||||
|
||||
bool isTypeEquivalent( NodeImplSharedPtr ni ) override;
|
||||
bool isDefined( const ustring &pathName ) override;
|
||||
|
||||
@@ -53,7 +54,7 @@ namespace e57
|
||||
void writeXml( ImageFileImplSharedPtr imf, CheckedFile &cf, int indent,
|
||||
const char *forcedFieldName = nullptr ) override;
|
||||
|
||||
#ifdef E57_DEBUG
|
||||
#ifdef E57_ENABLE_DIAGNOSTIC_OUTPUT
|
||||
void dump( int indent = 0, std::ostream &os = std::cout ) const override;
|
||||
#endif
|
||||
|
||||
|
||||
+68
-53
@@ -1,60 +1,75 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
# SPDX-License-Identifier: BSL-1.0
|
||||
# Copyright 2020 Andy Maloney <asmaloney@gmail.com>
|
||||
|
||||
target_sources( E57Format
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/BlobNodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/BlobNodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/CheckedFile.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/CheckedFile.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Common.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Common.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/CompressedVectorNodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/CompressedVectorNodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/CompressedVectorReaderImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/CompressedVectorReaderImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/CompressedVectorWriterImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/CompressedVectorWriterImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/DecodeChannel.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/DecodeChannel.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Decoder.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Decoder.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Encoder.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Encoder.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/FloatNodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/FloatNodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/IntegerNodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/IntegerNodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/NodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/NodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/Packet.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/Packet.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/ImageFileImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/ImageFileImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/ReaderImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/ReaderImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/ScaledIntegerNodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/ScaledIntegerNodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/SectionHeaders.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/SectionHeaders.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/SourceDestBufferImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/SourceDestBufferImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/StringNodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/StringNodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/StructureNodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/StructureNodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/VectorNodeImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/VectorNodeImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/WriterImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/WriterImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57Exception.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57Format.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57SimpleData.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57SimpleReader.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57SimpleWriter.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57Version.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57XmlParser.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/E57XmlParser.h
|
||||
ASTMVersion.h
|
||||
BlobNode.cpp
|
||||
BlobNodeImpl.h
|
||||
BlobNodeImpl.cpp
|
||||
CheckedFile.h
|
||||
CheckedFile.cpp
|
||||
Common.h
|
||||
Common.cpp
|
||||
CompressedVectorNode.cpp
|
||||
CompressedVectorNodeImpl.h
|
||||
CompressedVectorNodeImpl.cpp
|
||||
CompressedVectorReader.cpp
|
||||
CompressedVectorReaderImpl.h
|
||||
CompressedVectorReaderImpl.cpp
|
||||
CompressedVectorWriter.cpp
|
||||
CompressedVectorWriterImpl.h
|
||||
CompressedVectorWriterImpl.cpp
|
||||
DecodeChannel.h
|
||||
DecodeChannel.cpp
|
||||
Decoder.h
|
||||
Decoder.cpp
|
||||
Encoder.h
|
||||
Encoder.cpp
|
||||
FloatNode.cpp
|
||||
FloatNodeImpl.h
|
||||
FloatNodeImpl.cpp
|
||||
ImageFile.cpp
|
||||
ImageFileImpl.h
|
||||
ImageFileImpl.cpp
|
||||
IntegerNode.cpp
|
||||
IntegerNodeImpl.h
|
||||
IntegerNodeImpl.cpp
|
||||
Node.cpp
|
||||
NodeImpl.h
|
||||
NodeImpl.cpp
|
||||
Packet.h
|
||||
Packet.cpp
|
||||
ReaderImpl.h
|
||||
ReaderImpl.cpp
|
||||
ScaledIntegerNode.cpp
|
||||
ScaledIntegerNodeImpl.h
|
||||
ScaledIntegerNodeImpl.cpp
|
||||
SectionHeaders.h
|
||||
SectionHeaders.cpp
|
||||
SourceDestBuffer.cpp
|
||||
SourceDestBufferImpl.h
|
||||
SourceDestBufferImpl.cpp
|
||||
StringNode.cpp
|
||||
StringFunctions.h
|
||||
StringFunctions.cpp
|
||||
StringNodeImpl.h
|
||||
StringNodeImpl.cpp
|
||||
StructureNode.cpp
|
||||
StructureNodeImpl.h
|
||||
StructureNodeImpl.cpp
|
||||
VectorNode.cpp
|
||||
VectorNodeImpl.h
|
||||
VectorNodeImpl.cpp
|
||||
WriterImpl.h
|
||||
WriterImpl.cpp
|
||||
E57Exception.cpp
|
||||
E57SimpleData.cpp
|
||||
E57SimpleReader.cpp
|
||||
E57SimpleWriter.cpp
|
||||
E57Version.cpp
|
||||
E57XmlParser.cpp
|
||||
E57XmlParser.h
|
||||
)
|
||||
|
||||
target_include_directories( E57Format
|
||||
|
||||
+782
-803
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user