Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void StringsToValues(tStrings *aList) const; | Convert strings in aList to integers. |
| 2 | TVecInt *StringsToValues(tStrings *aList, const int ListIndex, const int Index = 0, const int Len = MtxVecEOA) const; | Convert strings in aList to integers starting at ListIndex. |
| 3 | TVecInt *StringsToValues(const DewArray<DewString> &aList) const; | |
| 4 | TVecInt *StringsToValues(const DewArray<DewString> &aList, int ListIndex, int Index = 0, int Len = MtxVecEOA) const; |
Overload 1: void StringsToValues(tStrings *aList) const;
Convert strings in aList to integers.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | aList | tStrings * |
Remarks:
Convert strings in aList to integers according to the IntPrecision property and store them in the Values array of the calling vector. The TMtxVecBase::Length of the calling vector is set to aList.Count.
Examples
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"
#include "MtxStrings.h"
using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;
void Example()
{
TVecInt *a, *b;
tStringList* Lines;
CreateIt(a, b);
Lines = new tStringList();
a->SetIt(DewArray<int>{1,2,3,4});
a->Add(1);
b->Size(a);
b->SetVal(1);
a->Add(b);
Lines->Clear();
a->ValuesToStrings(Lines);
b->ValuesToStrings(Lines);
Lines->SaveToFile("Test.txt");
Lines->LoadFromFile("Test.txt");
a->StringsToValues(Lines);
delete Lines;
FreeIt(a, b);
}
See Also: VectorInt::ValuesToStrings
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler
Overload 2: TVecInt *StringsToValues(tStrings *aList, const int ListIndex, const int Index = 0, const int Len = MtxVecEOA) const;
Convert strings in aList to integers starting at ListIndex.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | aList | tStrings * | |
| 2 | ListIndex | const int | |
| 3 | Index = 0 | const int | |
| 4 | Len = MtxVecEOA | const int |
Remarks:
Store them in the Values array of the calling vector from Index to Index+Len-1. The Length property of the calling vector is not changed. If array bounds are overrun and exception is raised.
Examples
#include "MtxStrings.h"
#include "MtxExprInt.h"
using namespace Dew;
using namespace Dew::Math;
void Example()
{
VectorInt a, b;
tStringList* Lines;
Lines = new tStringList();
a = {1, 2, 3, 4};
a.Add(1);
b.Size(a);
b.SetVal(1);
a.Add(b);
Lines->Clear();
a.ValuesToStrings(Lines);
b.ValuesToStrings(Lines);
Lines->SaveToFile("Test.txt");
Lines->LoadFromFile("Test.txt");
a.StringsToValues(Lines);
delete Lines;
}
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler
Overload 3: TVecInt *StringsToValues(const DewArray<DewString> &aList) const;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | aList | const DewArray<DewString> & |
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler
Overload 4: TVecInt *StringsToValues(const DewArray<DewString> &aList, int ListIndex, int Index = 0, int Len = MtxVecEOA) const;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | aList | const DewArray<DewString> & | |
| 2 | ListIndex | int | |
| 3 | Index = 0 | int | |
| 4 | Len = MtxVecEOA | int |
Declared in Dew::Math::VectorInt · Dew.Math/MtxExprInt.h · Cross-compiler