From the course: Level Up: C++

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

JSON file validation

JSON file validation - C++ Tutorial

From the course: Level Up: C++

JSON file validation

(playful music) - [Instructor] In challenge 15, you will read a text file and examine its contents to perform some basic JSON file validation. Your task is to write an application that reads a JSON file to check if it's valid or not. Base your verdict on the balance of brackets also known as square brackets, braces also known as curly brackets, and quotes. The application must display a message indicating if the JSON file passed the tests or not. Checking a JSON files validity can get complicated, so let's keep it simple for this challenge. Only count double quotes, not single quotes. Assume simple content with no escape characters inside strings, that's between quotes. In fact, ignore everything between quotes. Here we have some examples of unacceptable sequences using only brackets and braces. We'll ignore the rest of the characters. This one begins with a closing character so it can be dismissed as invalid right…

Contents