Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
mirek wrote on Wed, 18 May 2022 12:04
Tom1 wrote on Wed, 18 May 2022 10:47
mirek wrote on Wed, 18 May 2022 11:29
Empty 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
Re: LoadFile("/sys/devices/virtual/thermal/ ...") does not work [message #58428 is a reply to message #58417] Thu, 19 May 2022 10:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Tom1 wrote on Wed, 18 May 2022 11:10


How about introducing an additional IsVoid variant?:
bool IsVoid(const String &s){ return s.IsVoid(); }

Best regards,

Tom


OK, done
Re: LoadFile("/sys/devices/virtual/thermal/ ...") does not work [message #58429 is a reply to message #58428] Thu, 19 May 2022 11:04 Go to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Thanks!
Previous Topic: BiArray::Create{Head,Tail} with variadic args
Next Topic: Serialize long as uint64 on some platforms
Goto Forum:
  


Current Time: Thu Apr 25 19:09:48 CEST 2024

Total time taken to generate the page: 0.02317 seconds