Ignore:
Timestamp:
Jan 17, 2024, 2:16:04 PM (6 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
5bf685f
Parents:
06280ad
Message:

Tweak string assignment-strcpy-strncpy and concatenate-strcat-strncat declarations.

Implement -n- versions correctly.

Refactor to include string_res layer.

Add missing tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/collections/string_res.cfa

    r06280ad re891349  
    563563}
    564564
     565string_res & assign(string_res & s, const string_res & src, size_t maxlen) {
     566    return assign_(s, src.Handle.s, min(src.Handle.lnth, maxlen), *0p);
     567}
     568
    565569string_res & assign(string_res & s, const char * buffer, size_t bsize) {
    566570    return assign_(s, buffer, bsize, *0p);
     
    637641}
    638642
     643void append(string_res & str1, const string_res & str2, size_t maxlen) {
     644    append( str1, str2.Handle.s, min(str2.Handle.lnth, maxlen) );
     645}
     646
    639647void ?+=?(string_res & s, char c) {
    640648    append( s, & c, 1 );
    641649}
    642 
     650void ?+=?(string_res & s, const char * c) {
     651    append( s, c, strlen(c) );
     652}
    643653
    644654///////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.