Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added the IntToHex function.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 21 Apr 2016 23:07:03 +0000 (00:07 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 21 Apr 2016 23:07:03 +0000 (00:07 +0100)
source/common/text.cpp
source/common/text.h

index d223993..f6549d2 100644 (file)
@@ -256,4 +256,14 @@ bool HexToInt(std::string *HexString, int *Number){
        
        return true;
        
+}
+
+bool IntToHex(int *Number, std::string *HexString, int HexFill){
+       
+       stringstream StringData;
+       StringData << setfill('0') << hex << setw(HexFill) << (*Number);
+       (*HexString) = StringData.str();
+       
+       return true;
+       
 }
\ No newline at end of file
index f50113e..fa74d9b 100644 (file)
@@ -7,6 +7,7 @@
 #include <map>
 #include <iostream>
 #include <stdexcept>
+#include <iomanip>
 
 struct PropertyNameValue{
        std::string Name;
@@ -20,5 +21,6 @@ std::multimap<std::string, std::string> ProcessTextVectors(std::vector<std::stri
 std::map<std::string, std::string> SplitValues(std::string InputData);
 PropertyNameValue SplitNameValue(std::string InputData);
 bool HexToInt(std::string *HexString, int *Number);
+bool IntToHex(int *Number, std::string *HexString, int HexFill);
 
 #endif
\ No newline at end of file
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy