Page MenuHome

Support Custom Header-Printing During Transform

Authored by Julian Eisel (Severin) on Jun 30 2015, 3:13 AM.



Planned to be used in D1373.

Also added two BLI_str functions to remove trailing/leading whitespace in a string.

The custom string (custom as in: Defined in code but not on an ugly low level) is currently appended to the existing string, although it might be better to do it the other way around since the existing string changes its width continuously while transforming. The functions to remove whitespace wouldn't be needed anymore then, but think it would still be useful for some other cases?!

Diff Detail

rB Blender

Event Timeline

Julian Eisel (Severin) retitled this revision from to Support Custom Header-Printing During Transform.
Julian Eisel (Severin) updated this object.
  • Fixing whitespace issues in whitespace remove functions ;)
Campbell Barton (campbellbarton) requested changes to this revision.EditedJun 30 2015, 6:18 AM
Campbell Barton (campbellbarton) edited edge metadata.

Generally having whitespace stripping functions is good.

  • Would use Python like naming BLI_str_lstrip / BLI_str_rstrip (we already have BLI_str_rstrip_float_zero for example).
  • Its assumed src, dst dont overlap, can use __restrict in header (also BLI_assert(src != dst) in function for good measure) that only covers basic mistakes and wont catch overlap.
  • When theres a source and destination string, its good to pass the length of the destination string to avoid buffer overrun.
  • For utility functions like this its good to add gtest, Try pass in all whitespace, no whitespace, single character surrounded with whitespace, empty string... etc.

Note, would rather have stripping functions review & commit handled separate from transform code.

This revision now requires changes to proceed.Jun 30 2015, 6:18 AM

We decided in IRC to go with a more simple solution for this. I'll create a separate patch for the whitespace stripping functions.