Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/src/string.cpp

    rc735afb rbc56f30  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
     29#include <cassert>
    2930#include <string>
    3031
     
    3435    {
    3536        // TODO: implement using stol once we have numeric limits
     37        __unimplemented();
    3638        return 0;
    3739    }
     
    4042    {
    4143        char* end;
    42         long result = hel::strtol(str.c_str(), &end, base);
     44        long result = ::strtol(str.c_str(), &end, base);
    4345
    4446        if (end != str.c_str())
     
    5658    {
    5759        char* end;
    58         unsigned long result = hel::strtoul(str.c_str(), &end, base);
     60        unsigned long result = ::strtoul(str.c_str(), &end, base);
    5961
    6062        if (end != str.c_str())
     
    7274    {
    7375        // TODO: implement using stol once we have numeric limits
     76        __unimplemented();
    7477        return 0;
    7578    }
     
    7881    {
    7982        // TODO: implement using stoul once we have numeric limits
     83        __unimplemented();
    8084        return 0;
    8185    }
     
    8488    {
    8589        // TODO: implement
     90        __unimplemented();
    8691        return 0.f;
    8792    }
     
    9095    {
    9196        // TODO: implement
     97        __unimplemented();
    9298        return 0.0;
    9399    }
     
    96102    {
    97103        // TODO: implement
     104        __unimplemented();
    98105        return 0.0l;
    99106    }
    100107
    101     namespace hel
    102     {
    103         extern "C" int asprintf(char**, const char*, ...);
    104     }
    105 
    106108    string to_string(int val)
    107109    {
    108110        char* tmp;
    109         hel::asprintf(&tmp, "%d", val);
     111        ::asprintf(&tmp, "%d", val);
    110112
    111113        std::string res{tmp};
     
    118120    {
    119121        char* tmp;
    120         hel::asprintf(&tmp, "%u", val);
     122        ::asprintf(&tmp, "%u", val);
    121123
    122124        std::string res{tmp};
     
    129131    {
    130132        char* tmp;
    131         hel::asprintf(&tmp, "%ld", val);
     133        ::asprintf(&tmp, "%ld", val);
    132134
    133135        std::string res{tmp};
     
    140142    {
    141143        char* tmp;
    142         hel::asprintf(&tmp, "%lu", val);
     144        ::asprintf(&tmp, "%lu", val);
    143145
    144146        std::string res{tmp};
     
    151153    {
    152154        char* tmp;
    153         hel::asprintf(&tmp, "%lld", val);
     155        ::asprintf(&tmp, "%lld", val);
    154156
    155157        std::string res{tmp};
     
    162164    {
    163165        char* tmp;
    164         hel::asprintf(&tmp, "%llu", val);
     166        ::asprintf(&tmp, "%llu", val);
    165167
    166168        std::string res{tmp};
     
    173175    {
    174176        char* tmp;
    175         hel::asprintf(&tmp, "%f", val);
     177        ::asprintf(&tmp, "%f", val);
    176178
    177179        std::string res{tmp};
     
    184186    {
    185187        char* tmp;
    186         hel::asprintf(&tmp, "%f", val);
     188        ::asprintf(&tmp, "%f", val);
    187189
    188190        std::string res{tmp};
     
    195197    {
    196198        char* tmp;
    197         hel::asprintf(&tmp, "%Lf", val);
     199        ::asprintf(&tmp, "%Lf", val);
    198200
    199201        std::string res{tmp};
     
    206208    {
    207209        // TODO: implement
     210        __unimplemented();
    208211        return 0;
    209212    }
     
    212215    {
    213216        // TODO: implement
     217        __unimplemented();
    214218        return 0;
    215219    }
     
    218222    {
    219223        // TODO: implement
     224        __unimplemented();
    220225        return 0;
    221226    }
     
    224229    {
    225230        // TODO: implement
     231        __unimplemented();
    226232        return 0;
    227233    }
     
    230236    {
    231237        // TODO: implement
     238        __unimplemented();
    232239        return 0;
    233240    }
     
    236243    {
    237244        // TODO: implement
     245        __unimplemented();
    238246        return 0.f;
    239247    }
     
    242250    {
    243251        // TODO: implement
     252        __unimplemented();
    244253        return 0.0;
    245254    }
     
    248257    {
    249258        // TODO: implement
     259        __unimplemented();
    250260        return 0.0l;
    251261    }
     
    254264    {
    255265        // TODO: implement
     266        __unimplemented();
    256267        return wstring{};
    257268    }
     
    260271    {
    261272        // TODO: implement
     273        __unimplemented();
    262274        return wstring{};
    263275    }
     
    266278    {
    267279        // TODO: implement
     280        __unimplemented();
    268281        return wstring{};
    269282    }
     
    272285    {
    273286        // TODO: implement
     287        __unimplemented();
    274288        return wstring{};
    275289    }
     
    278292    {
    279293        // TODO: implement
     294        __unimplemented();
    280295        return wstring{};
    281296    }
     
    284299    {
    285300        // TODO: implement
     301        __unimplemented();
    286302        return wstring{};
    287303    }
     
    290306    {
    291307        // TODO: implement
     308        __unimplemented();
    292309        return wstring{};
    293310    }
     
    296313    {
    297314        // TODO: implement
     315        __unimplemented();
    298316        return wstring{};
    299317    }
     
    302320    {
    303321        // TODO: implement
     322        __unimplemented();
    304323        return wstring{};
    305324    }
Note: See TracChangeset for help on using the changeset viewer.