Home » U++ Library support » U++ Core » LoadFile("/sys/devices/virtual/thermal/ ...") does not work
Re: LoadFile("/sys/devices/virtual/thermal/ ...") does not work [message #58417 is a reply to message #58416] |
Wed, 18 May 2022 11:10 |
Tom1
Messages: 1242 Registered: March 2007
|
Senior Contributor |
|
|
mirek wrote on Wed, 18 May 2022 12:04Tom1 wrote on Wed, 18 May 2022 10:47mirek wrote on Wed, 18 May 2022 11:29Empty file issue fixed (with len >= 0).
Not sure what do you mean with IsVoid problem, piece of code maybe?
OK, I found the reason causing part of my testing issues:
if(String::GetVoid().IsVoid()) Cout() << "String::GetVoid().IsVoid() works!\n";
else Cout() << "String::GetVoid().IsVoid() fails!\n";
if(IsVoid(String::GetVoid())) Cout() << "IsVoid(String::GetVoid()) works!\n";
else Cout() << "IsVoid(String::GetVoid()) fails!\n";
Best regards,
Tom
EDIT: Improved test code.
Uhm, that is actually API problem:
IsVoid(const Value&) function is about Value - it tells you that Value was not assigned anything. In above example you assign it a String, so it must return false.
I agree this is a bit confusing, but I am not sure there is a solution to that.
Mirek
How about introducing an additional IsVoid variant?:
bool IsVoid(const String &s){ return s.IsVoid(); }
Best regards,
Tom
|
|
|
|
|
Goto Forum:
Current Time: Thu Sep 19 03:35:59 CEST 2024
Total time taken to generate the page: 0.03407 seconds
|