added: to membuffer:
template<typename in_item_type>
void append(const in_item_type * item_array, size_t len);
when adding values from item_array are casted to the type of the internal buffer
changed: some minor optimizations in Space (in Add() methods with WTextStream as an argument)
changed: removed following write() methods from TextStreamBase:
TextStreamBase & write(const char * buf, size_t len);
TextStreamBase & write(const wchar_t * buf, size_t len);
and added a template instead:
template<typename in_buffer_type>
TextStreamBase & write(const in_buffer_type * buf, size_t len);
this allows to write char* buffer to TextStreamBase<wchar_t...> (and vice versa)
added: two write() methods to TextStreamBase:
write(const char * format, double val);
write(const wchar_t * format, double val);
converting double value to the text (format is the same as in snprintf)
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@448 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -574,10 +574,8 @@ return val;
|
||||
std::wstring & Space::Add(const wchar_t * name, const WTextStream & value)
|
||||
{
|
||||
tmp_name = name;
|
||||
value.to_string(tmp_value_text, true);
|
||||
|
||||
std::wstring & val = table_single[tmp_name];
|
||||
val = tmp_value_text;
|
||||
value.to_string(val, true);
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -586,11 +584,8 @@ return val;
|
||||
|
||||
std::wstring & Space::Add(const std::wstring & name, const WTextStream & value)
|
||||
{
|
||||
tmp_name = name;
|
||||
value.to_string(tmp_value_text, true);
|
||||
|
||||
std::wstring & val = table_single[tmp_name];
|
||||
val = tmp_value_text;
|
||||
std::wstring & val = table_single[name];
|
||||
value.to_string(val, true);
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -600,10 +595,9 @@ return val;
|
||||
std::wstring & Space::Add(const WTextStream & name, const WTextStream & value)
|
||||
{
|
||||
name.to_string(tmp_name, true);
|
||||
value.to_string(tmp_value_text, true);
|
||||
|
||||
std::wstring & val = table_single[tmp_name];
|
||||
val = tmp_value_text;
|
||||
value.to_string(val, true);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user