Ignore:
Timestamp:
Sep 5, 2020, 7:17:44 PM (5 years ago)
Author:
pr
Message:

Add BSUString copy constructor for codepaged C strings.
Substitute "(C)" for copyright symbol on unsupported codepages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cppbase/bs_string_uni.cpp

    r254 r449  
    99
    1010/*
    11  *      This file Copyright (C) 2002 Ulrich M”ller.
     11 *      This file Copyright (C) 2020 Ulrich M”ller.
    1212 *      This program is free software; you can redistribute it and/or modify
    1313 *      it under the terms of the GNU General Public License as published by
     
    104104
    105105/*
     106 *@@ BSUString:
     107 *      copy constructor to convert from a
     108 *      codepaged C string, using the
     109 *      specified BSUniCodec for conversion.
     110 *
     111 *@@added WarpIN V1.0.25 (2020-09-05) [pr]
     112 */
     113
     114BSUString::BSUString(BSUniCodec *pCodec,
     115                     const char *psz)
     116    : BSStringBase(tBSUString)
     117{
     118    STRINGLOCK;
     119
     120    if (!pCodec)
     121        throw BSExcptBase("pCodec is NULL.");
     122
     123    size_type st;
     124    if (st = strlen(psz))
     125    {
     126        pCodec->Codepage2Uni(*this,
     127                             psz,
     128                             st);
     129    }
     130}
     131
     132/*
    106133 *@@ operator[]:
    107134 *      returns the ul'th character of the
     
    235262    FreeBuf();
    236263
     264    if (!pCodec)
     265        throw BSExcptBase("pCodec is NULL.");
     266
    237267    size_type st;
    238268    if (st = strlen(psz))
Note: See TracChangeset for help on using the changeset viewer.