1

How can a file like this be parsed, especially in the Devices section? Also, does boost handle the input stream, or does that have be handled by additional code?

[Configuration]
IPAddress=192.168.1.1
Device Port=12345
Management Port = 54321

[Devices]
main server DEADBEEF 0
sales FEEDBEEF 1
marketing DEADDEED  2

I need all three columns under Devices, which are a description, MAC address and a register number.

This article seems close but, I want to do this with a file: Handle complex options with Boost's program_options

I suppose I can structure the devices like this:

[Device]
description='main server'
mac_address=DEADBEEF
register=0

[Device]
description-...
mac_address=...
register=...
Community
  • 1
  • 1
bentaisan
  • 1,056
  • 3
  • 12
  • 29

0 Answers0