| 
									
										
										
										
											2016-11-23 13:31:47 +01:00
										 |  |  | /****************************************************************************
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Copyright (C) 2016 The Qt Company Ltd. | 
					
						
							|  |  |  | ** Contact: https://www.qt.io/licensing/
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** This file is part of Qt Creator. | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** Commercial License Usage | 
					
						
							|  |  |  | ** Licensees holding valid commercial Qt licenses may use this file in | 
					
						
							|  |  |  | ** accordance with the commercial license agreement provided with the | 
					
						
							|  |  |  | ** Software or, alternatively, in accordance with the terms contained in | 
					
						
							|  |  |  | ** a written agreement between you and The Qt Company. For licensing terms | 
					
						
							|  |  |  | ** and conditions see https://www.qt.io/terms-conditions. For further
 | 
					
						
							|  |  |  | ** information use the contact form at https://www.qt.io/contact-us.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ** GNU General Public License Usage | 
					
						
							|  |  |  | ** Alternatively, this file may be used under the terms of the GNU | 
					
						
							|  |  |  | ** General Public License version 3 as published by the Free Software | 
					
						
							|  |  |  | ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT | 
					
						
							|  |  |  | ** included in the packaging of this file. Please review the following | 
					
						
							|  |  |  | ** information to ensure the GNU General Public License requirements will | 
					
						
							|  |  |  | ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
 | 
					
						
							|  |  |  | ** | 
					
						
							|  |  |  | ****************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "gtest-creator-printing.h"
 | 
					
						
							| 
									
										
										
										
											2020-06-10 13:50:35 +02:00
										 |  |  | #include "gtest-std-printing.h"
 | 
					
						
							| 
									
										
										
										
											2016-11-23 13:31:47 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-18 13:38:58 +02:00
										 |  |  | #include "gtest-qt-printing.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-23 13:31:47 +01:00
										 |  |  | #include <gtest/gtest-printers.h>
 | 
					
						
							| 
									
										
										
										
											2018-08-21 11:54:51 +02:00
										 |  |  | #include <gmock/gmock-matchers.h>
 | 
					
						
							| 
									
										
										
										
											2016-11-23 13:31:47 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | #include <clangcodemodelclientmessages.h>
 | 
					
						
							|  |  |  | #include <clangcodemodelservermessages.h>
 | 
					
						
							| 
									
										
										
										
											2020-04-27 20:01:38 +02:00
										 |  |  | #include <clangtools/clangtoolsdiagnostic.h>
 | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | #include <debugger/analyzer/diagnosticlocation.h>
 | 
					
						
							| 
									
										
										
										
											2020-06-18 19:46:01 +02:00
										 |  |  | #include <modelnode.h>
 | 
					
						
							| 
									
										
										
										
											2021-08-03 15:03:36 +02:00
										 |  |  | #include <projectstorage/filestatus.h>
 | 
					
						
							| 
									
										
										
										
											2021-07-29 11:19:02 +02:00
										 |  |  | #include <projectstorage/projectstoragepathwatchertypes.h>
 | 
					
						
							| 
									
										
										
										
											2021-05-04 13:27:42 +02:00
										 |  |  | #include <projectstorage/projectstoragetypes.h>
 | 
					
						
							| 
									
										
										
										
											2021-05-06 12:26:39 +02:00
										 |  |  | #include <projectstorage/sourcepathcachetypes.h>
 | 
					
						
							| 
									
										
										
										
											2021-07-29 11:19:02 +02:00
										 |  |  | #include <sqlite.h>
 | 
					
						
							| 
									
										
										
										
											2020-05-27 23:48:03 +02:00
										 |  |  | #include <sqlitesessionchangeset.h>
 | 
					
						
							| 
									
										
										
										
											2020-04-27 20:01:38 +02:00
										 |  |  | #include <sqlitevalue.h>
 | 
					
						
							| 
									
										
										
										
											2019-04-10 19:24:36 +02:00
										 |  |  | #include <tooltipinfo.h>
 | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | #include <utils/fileutils.h>
 | 
					
						
							| 
									
										
										
										
											2021-06-14 11:47:51 +02:00
										 |  |  | #include <utils/linecolumn.h>
 | 
					
						
							| 
									
										
										
										
											2020-06-18 19:46:01 +02:00
										 |  |  | #include <variantproperty.h>
 | 
					
						
							| 
									
										
										
										
											2020-09-16 13:44:43 +02:00
										 |  |  | #include <qmldesigner/designercore/imagecache/imagecachestorageinterface.h>
 | 
					
						
							| 
									
										
										
										
											2017-09-21 11:43:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-28 22:07:28 +01:00
										 |  |  | void PrintTo(const Utf8String &text, ::std::ostream *os) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     *os << text; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-21 11:43:59 +02:00
										 |  |  | namespace Utils { | 
					
						
							| 
									
										
										
										
											2018-01-22 14:21:01 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const LineColumn &lineColumn) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << lineColumn.line << ", " << lineColumn.column << ")"; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | namespace { | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  | const char * toText(Utils::Language language) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     using Utils::Language; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     switch (language) { | 
					
						
							|  |  |  |     case Language::C: | 
					
						
							|  |  |  |         return "C"; | 
					
						
							|  |  |  |     case Language::Cxx: | 
					
						
							|  |  |  |         return "Cxx"; | 
					
						
							| 
									
										
										
										
											2019-03-19 17:00:03 +01:00
										 |  |  |     case Language::None: | 
					
						
							|  |  |  |         return "None"; | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | } // namespace
 | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const Utils::Language &language) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "Utils::" << toText(language); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | namespace { | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  | const char * toText(Utils::LanguageVersion languageVersion) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     using Utils::LanguageVersion; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     switch (languageVersion) { | 
					
						
							|  |  |  |     case LanguageVersion::C11: | 
					
						
							|  |  |  |         return "C11"; | 
					
						
							|  |  |  |     case LanguageVersion::C18: | 
					
						
							|  |  |  |         return "C18"; | 
					
						
							|  |  |  |     case LanguageVersion::C89: | 
					
						
							|  |  |  |         return "C89"; | 
					
						
							|  |  |  |     case LanguageVersion::C99: | 
					
						
							|  |  |  |         return "C99"; | 
					
						
							|  |  |  |     case LanguageVersion::CXX03: | 
					
						
							|  |  |  |         return "CXX03"; | 
					
						
							|  |  |  |     case LanguageVersion::CXX11: | 
					
						
							|  |  |  |         return "CXX11"; | 
					
						
							|  |  |  |     case LanguageVersion::CXX14: | 
					
						
							|  |  |  |         return "CXX14"; | 
					
						
							|  |  |  |     case LanguageVersion::CXX17: | 
					
						
							|  |  |  |         return "CXX17"; | 
					
						
							| 
									
										
										
										
											2021-08-19 16:27:54 +02:00
										 |  |  |     case LanguageVersion::CXX20: | 
					
						
							|  |  |  |         return "CXX20"; | 
					
						
							|  |  |  |     case LanguageVersion::CXX2b: | 
					
						
							|  |  |  |         return "CXX2b"; | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  |     case LanguageVersion::CXX98: | 
					
						
							|  |  |  |         return "CXX98"; | 
					
						
							| 
									
										
										
										
											2019-03-19 17:00:03 +01:00
										 |  |  |     case LanguageVersion::None: | 
					
						
							|  |  |  |         return "None"; | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | } // namespace
 | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const Utils::LanguageVersion &languageVersion) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |      return out << "Utils::" << toText(languageVersion); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | namespace { | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  | const std::string toText(Utils::LanguageExtension extension, std::string prefix = {}) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     std::stringstream out; | 
					
						
							|  |  |  |     using Utils::LanguageExtension; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (extension == LanguageExtension::None) { | 
					
						
							|  |  |  |         out << prefix << "None"; | 
					
						
							|  |  |  |     } else if (extension == LanguageExtension::All) { | 
					
						
							|  |  |  |         out << prefix << "All"; | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |         std::string split = ""; | 
					
						
							|  |  |  |         if (extension == LanguageExtension::Gnu) { | 
					
						
							|  |  |  |             out << prefix << "Gnu"; | 
					
						
							|  |  |  |             split = " | "; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (extension == LanguageExtension::Microsoft) { | 
					
						
							|  |  |  |             out << split << prefix << "Microsoft"; | 
					
						
							|  |  |  |             split = " | "; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (extension == LanguageExtension::Borland) { | 
					
						
							|  |  |  |             out << split << prefix << "Borland"; | 
					
						
							|  |  |  |             split = " | "; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (extension == LanguageExtension::OpenMP) { | 
					
						
							|  |  |  |             out << split << prefix << "OpenMP"; | 
					
						
							|  |  |  |             split = " | "; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (extension == LanguageExtension::ObjectiveC) { | 
					
						
							|  |  |  |             out << split << prefix << "ObjectiveC"; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out.str(); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | } // namespace
 | 
					
						
							| 
									
										
										
										
											2018-12-17 12:06:57 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const Utils::LanguageExtension &languageExtension) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << toText(languageExtension, "Utils::"); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-07 19:01:01 +02:00
										 |  |  | void PrintTo(Utils::SmallStringView text, ::std::ostream *os) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-09-03 14:38:01 +02:00
										 |  |  |     *os << "\"" << text << "\""; | 
					
						
							| 
									
										
										
										
											2018-08-07 19:01:01 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-21 11:43:59 +02:00
										 |  |  | void PrintTo(const Utils::SmallString &text, ::std::ostream *os) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-09-03 14:38:01 +02:00
										 |  |  |     *os << "\"" << text << "\""; | 
					
						
							| 
									
										
										
										
											2017-09-21 11:43:59 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-28 22:07:28 +01:00
										 |  |  | void PrintTo(const Utils::PathString &text, ::std::ostream *os) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-09-03 14:38:01 +02:00
										 |  |  |     *os << "\"" << text << "\""; | 
					
						
							| 
									
										
										
										
											2017-12-28 22:07:28 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const FilePath &filePath) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << filePath.toString(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-21 11:43:59 +02:00
										 |  |  | } // namespace Utils
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-27 20:01:38 +02:00
										 |  |  | namespace Sqlite { | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const Value &value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     out << "("; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     switch (value.type()) { | 
					
						
							|  |  |  |     case Sqlite::ValueType::Integer: | 
					
						
							|  |  |  |         out << value.toInteger(); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     case Sqlite::ValueType::Float: | 
					
						
							|  |  |  |         out << value.toFloat(); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     case Sqlite::ValueType::String: | 
					
						
							|  |  |  |         out << "\"" << value.toStringView() << "\""; | 
					
						
							|  |  |  |         break; | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  |     case Sqlite::ValueType::Blob: | 
					
						
							|  |  |  |         out << "blob"; | 
					
						
							|  |  |  |         break; | 
					
						
							| 
									
										
										
										
											2020-06-09 17:31:06 +02:00
										 |  |  |     case Sqlite::ValueType::Null: | 
					
						
							|  |  |  |         out << "null"; | 
					
						
							|  |  |  |         break; | 
					
						
							| 
									
										
										
										
											2020-04-27 20:01:38 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out << ")"; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2020-05-27 23:48:03 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-27 15:09:25 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const ValueView &value) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     out << "("; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     switch (value.type()) { | 
					
						
							|  |  |  |     case Sqlite::ValueType::Integer: | 
					
						
							|  |  |  |         out << value.toInteger(); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     case Sqlite::ValueType::Float: | 
					
						
							|  |  |  |         out << value.toFloat(); | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     case Sqlite::ValueType::String: | 
					
						
							|  |  |  |         out << "\"" << value.toStringView() << "\""; | 
					
						
							|  |  |  |         break; | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  |     case Sqlite::ValueType::Blob: | 
					
						
							|  |  |  |         out << "blob"; | 
					
						
							|  |  |  |         break; | 
					
						
							| 
									
										
										
										
											2020-10-27 15:09:25 +01:00
										 |  |  |     case Sqlite::ValueType::Null: | 
					
						
							|  |  |  |         out << "null"; | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-27 23:48:03 +02:00
										 |  |  | namespace { | 
					
						
							|  |  |  | Utils::SmallStringView operationText(int operation) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (operation) { | 
					
						
							|  |  |  |     case SQLITE_INSERT: | 
					
						
							|  |  |  |         return "INSERT"; | 
					
						
							|  |  |  |     case SQLITE_UPDATE: | 
					
						
							|  |  |  |         return "UPDATE"; | 
					
						
							|  |  |  |     case SQLITE_DELETE: | 
					
						
							|  |  |  |         return "DELETE"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return {}; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, sqlite3_changeset_iter *iter) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     out << "("; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const char *tableName = nullptr; | 
					
						
							|  |  |  |     int columns = 0; | 
					
						
							|  |  |  |     int operation = 0; | 
					
						
							|  |  |  |     sqlite3_value *value = nullptr; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sqlite3changeset_op(iter, &tableName, &columns, &operation, 0); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     out << operationText(operation) << " " << tableName << " {"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (operation == SQLITE_UPDATE || operation == SQLITE_DELETE) { | 
					
						
							|  |  |  |         out << "Old: ["; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         for (int i = 0; i < columns; i++) { | 
					
						
							|  |  |  |             sqlite3changeset_old(iter, i, &value); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (value) | 
					
						
							|  |  |  |                 out << " " << sqlite3_value_text(value); | 
					
						
							|  |  |  |             else | 
					
						
							|  |  |  |                 out << " -"; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         out << "]"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (operation == SQLITE_UPDATE) | 
					
						
							|  |  |  |         out << ", "; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (operation == SQLITE_UPDATE || operation == SQLITE_INSERT) { | 
					
						
							|  |  |  |         out << "New: ["; | 
					
						
							|  |  |  |         for (int i = 0; i < columns; i++) { | 
					
						
							|  |  |  |             sqlite3changeset_new(iter, i, &value); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             if (value) | 
					
						
							|  |  |  |                 out << " " << sqlite3_value_text(value); | 
					
						
							|  |  |  |             else | 
					
						
							|  |  |  |                 out << " -"; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         out << "]"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     out << "})"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2020-11-05 18:12:26 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | const char *toText(Operation operation) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (operation) { | 
					
						
							|  |  |  |     case Operation::Invalid: | 
					
						
							|  |  |  |         return "Invalid"; | 
					
						
							|  |  |  |     case Operation::Insert: | 
					
						
							|  |  |  |         return "Invalid"; | 
					
						
							|  |  |  |     case Operation::Update: | 
					
						
							|  |  |  |         return "Invalid"; | 
					
						
							|  |  |  |     case Operation::Delete: | 
					
						
							|  |  |  |         return "Invalid"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-05-12 12:21:58 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | const char *toText(LockingMode lockingMode) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (lockingMode) { | 
					
						
							|  |  |  |     case LockingMode::Default: | 
					
						
							|  |  |  |         return "Default"; | 
					
						
							|  |  |  |     case LockingMode::Normal: | 
					
						
							|  |  |  |         return "Normal"; | 
					
						
							|  |  |  |     case LockingMode::Exclusive: | 
					
						
							|  |  |  |         return "Exclusive"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2020-05-27 23:48:03 +02:00
										 |  |  | } // namespace
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const SessionChangeSet &changeset) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     sqlite3_changeset_iter *iter = nullptr; | 
					
						
							| 
									
										
										
										
											2020-10-27 15:09:25 +01:00
										 |  |  |     sqlite3changeset_start(&iter, changeset.size(), const_cast<void *>(changeset.data())); | 
					
						
							| 
									
										
										
										
											2020-05-27 23:48:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     out << "ChangeSets(["; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (SQLITE_ROW == sqlite3changeset_next(iter)) { | 
					
						
							|  |  |  |         out << iter; | 
					
						
							|  |  |  |         while (SQLITE_ROW == sqlite3changeset_next(iter)) | 
					
						
							|  |  |  |             out << ", " << iter; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     sqlite3changeset_finalize(iter); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     out << "])"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2020-10-27 15:09:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-12 12:21:58 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, LockingMode lockingMode) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << toText(lockingMode); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-05 18:12:26 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &out, Operation operation) | 
					
						
							| 
									
										
										
										
											2020-10-27 15:09:25 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2020-11-05 18:12:26 +01:00
										 |  |  |     return out << toText(operation); | 
					
						
							| 
									
										
										
										
											2020-10-27 15:09:25 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-05 18:12:26 +01:00
										 |  |  | namespace SessionChangeSetInternal { | 
					
						
							|  |  |  | namespace { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-27 15:09:25 +01:00
										 |  |  | const char *toText(State state) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (state) { | 
					
						
							|  |  |  |     case State::Invalid: | 
					
						
							|  |  |  |         return "Invalid"; | 
					
						
							|  |  |  |     case State::Row: | 
					
						
							|  |  |  |         return "Row"; | 
					
						
							|  |  |  |     case State::Done: | 
					
						
							|  |  |  |         return "Done"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | } // namespace
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, SentinelIterator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "sentinel"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, State state) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << toText(state); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const Tuple &tuple) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << tuple.operation << ", " << tuple.columnCount << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const ValueViews &valueViews) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << valueViews.newValue << ", " << valueViews.oldValue << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const ConstIterator &iterator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << (*iterator) << ", " << iterator.state() << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const ConstTupleIterator &iterator) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     auto value = *iterator; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out << "(" << value.newValue << ", " << value.newValue << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace SessionChangeSetInternal
 | 
					
						
							| 
									
										
										
										
											2020-04-27 20:01:38 +02:00
										 |  |  | } // namespace Sqlite
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-21 11:43:59 +02:00
										 |  |  | namespace ClangBackEnd { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-06-01 10:46:20 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const FollowSymbolResult &result) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							|  |  |  |        << result.range | 
					
						
							| 
									
										
										
										
											2018-06-07 14:23:07 +02:00
										 |  |  |        << ", " << result.isResultOnlyForFallBack | 
					
						
							| 
									
										
										
										
											2018-06-01 10:46:20 +02:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const FollowSymbolMessage &message) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |       os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |          << message.fileContainer << ", " | 
					
						
							|  |  |  |          << message.ticketNumber << ", " | 
					
						
							| 
									
										
										
										
											2018-06-01 10:46:20 +02:00
										 |  |  |          << message.result << ", " | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |          << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const RequestCompletionsMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.filePath << ", " | 
					
						
							|  |  |  |        << message.line << ", " | 
					
						
							|  |  |  |        << message.column << ", " | 
					
						
							|  |  |  |        << message.ticketNumber << ", " | 
					
						
							|  |  |  |        << message.funcNameStartLine << ", " | 
					
						
							|  |  |  |        << message.funcNameStartColumn | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |      return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const DocumentsOpenedMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  |     os << "DocumentsOpenedMessage(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.fileContainers << ", " | 
					
						
							|  |  |  |        << message.currentEditorFilePath << ", " | 
					
						
							|  |  |  |        << message.visibleEditorFilePaths << ")"; | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const EndMessage &/*message*/) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return os << "()"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const AliveMessage &/*message*/) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return os << "()"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const CompletionsMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.codeCompletions << ", " | 
					
						
							|  |  |  |        << message.ticketNumber | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const AnnotationsMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  |     os << "AnnotationsMessage(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.fileContainer | 
					
						
							|  |  |  |        << "," << message.diagnostics.size() | 
					
						
							|  |  |  |        << "," << !message.firstHeaderErrorDiagnostic.text.isEmpty() | 
					
						
							|  |  |  |        << "," << message.tokenInfos.size() | 
					
						
							|  |  |  |        << "," << message.skippedPreprocessorRanges.size() | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const ReferencesMessage &message) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |       os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |          << message.fileContainer << ", " | 
					
						
							|  |  |  |          << message.ticketNumber << ", " | 
					
						
							|  |  |  |          << message.isLocalVariable << ", " | 
					
						
							|  |  |  |          << message.references << ", " | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |          << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 12:29:43 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const ToolTipMessage &message) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |       os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |          << message.fileContainer << ", " | 
					
						
							|  |  |  |          << message.ticketNumber << ", " | 
					
						
							|  |  |  |          << message.toolTipInfo << ", " | 
					
						
							| 
									
										
										
										
											2018-01-12 12:29:43 +01:00
										 |  |  |          << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const EchoMessage &/*message*/) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |      return os << "()"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const DocumentsClosedMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.fileContainers | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const CodeCompletion &message) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.text << ", " | 
					
						
							|  |  |  |        << message.priority << ", " | 
					
						
							|  |  |  |        << message.completionKind << ", " | 
					
						
							|  |  |  |        << message.availability << ", " | 
					
						
							|  |  |  |        << message.hasParameters | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const CodeCompletionChunk &chunk) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << chunk.kind << ", " | 
					
						
							|  |  |  |        << chunk.text; | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     if (chunk.isOptional) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |         os << ", optional"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     os << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | static const char *severityToText(DiagnosticSeverity severity) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (severity) { | 
					
						
							|  |  |  |         case DiagnosticSeverity::Ignored: return "Ignored"; | 
					
						
							|  |  |  |         case DiagnosticSeverity::Note: return "Note"; | 
					
						
							|  |  |  |         case DiagnosticSeverity::Warning: return "Warning"; | 
					
						
							|  |  |  |         case DiagnosticSeverity::Error: return "Error"; | 
					
						
							|  |  |  |         case DiagnosticSeverity::Fatal: return "Fatal"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Q_UNREACHABLE(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const DiagnosticContainer &container) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << severityToText(container.severity) << ": " | 
					
						
							|  |  |  |        << container.text << ", " | 
					
						
							|  |  |  |        << container.category << ", " | 
					
						
							|  |  |  |        << container.enableOption << ", " | 
					
						
							|  |  |  |        << container.location << ", " | 
					
						
							|  |  |  |        << container.ranges << ", " | 
					
						
							|  |  |  |        << container.fixIts << ", " | 
					
						
							|  |  |  |        << container.children << ")"; | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const FileContainer &container) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |         << container.filePath << ", " | 
					
						
							| 
									
										
										
										
											2018-09-25 09:41:32 +02:00
										 |  |  |         << container.compilationArguments << ", " | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |         << container.documentRevision << ", " | 
					
						
							|  |  |  |         << container.textCodecName; | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |     if (container.hasUnsavedFileContent) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |         os << ", " | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |            << container.unsavedFileContent; | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     os << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const FixItContainer &container) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << container.text << ", " | 
					
						
							|  |  |  |        << container.range | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define RETURN_TEXT_FOR_CASE(enumValue) case HighlightingType::enumValue: return #enumValue
 | 
					
						
							|  |  |  | static const char *highlightingTypeToCStringLiteral(HighlightingType type) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (type) { | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Invalid); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Comment); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Keyword); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(StringLiteral); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(NumberLiteral); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Function); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(VirtualFunction); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Type); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(LocalVariable); | 
					
						
							| 
									
										
										
										
											2021-03-18 11:13:17 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(Parameter); | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(GlobalVariable); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Field); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Enumeration); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Operator); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Preprocessor); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Label); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(FunctionDefinition); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(OutputArgument); | 
					
						
							| 
									
										
										
										
											2018-05-08 11:21:42 +02:00
										 |  |  |         RETURN_TEXT_FOR_CASE(OverloadedOperator); | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(PreprocessorDefinition); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(PreprocessorExpansion); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(PrimitiveType); | 
					
						
							| 
									
										
										
										
											2018-08-22 17:25:12 +02:00
										 |  |  |         RETURN_TEXT_FOR_CASE(Punctuation); | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(Declaration); | 
					
						
							| 
									
										
										
										
											2018-01-12 09:44:05 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(Namespace); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Class); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Struct); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Enum); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Union); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(TypeAlias); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(Typedef); | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(QtProperty); | 
					
						
							| 
									
										
										
										
											2018-02-14 12:24:21 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(ObjectiveCClass); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(ObjectiveCCategory); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(ObjectiveCProtocol); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(ObjectiveCInterface); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(ObjectiveCImplementation); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(ObjectiveCProperty); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(ObjectiveCMethod); | 
					
						
							| 
									
										
										
										
											2018-07-19 00:01:20 +03:00
										 |  |  |         RETURN_TEXT_FOR_CASE(TemplateTypeParameter); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(TemplateTemplateParameter); | 
					
						
							| 
									
										
										
										
											2021-01-25 17:46:00 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(AngleBracketOpen); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(AngleBracketClose); | 
					
						
							| 
									
										
										
										
											2021-04-15 13:54:02 +02:00
										 |  |  |         RETURN_TEXT_FOR_CASE(DoubleAngleBracketClose); | 
					
						
							| 
									
										
										
										
											2021-02-10 17:49:04 +01:00
										 |  |  |         RETURN_TEXT_FOR_CASE(TernaryIf); | 
					
						
							|  |  |  |         RETURN_TEXT_FOR_CASE(TernaryElse); | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #undef RETURN_TEXT_FOR_CASE
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, HighlightingType highlightingType) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return os << highlightingTypeToCStringLiteral(highlightingType); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, HighlightingTypes types) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							|  |  |  |        << types.mainHighlightingType; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     if (!types.mixinHighlightingTypes.empty()) | 
					
						
							|  |  |  |        os << ", "<< types.mixinHighlightingTypes; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     os << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const ExtraInfo &extraInfo) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							|  |  |  |        << extraInfo.token << ", " | 
					
						
							|  |  |  |        << extraInfo.typeSpelling << ", " | 
					
						
							|  |  |  |        << extraInfo.semanticParentTypeSpelling << ", " | 
					
						
							|  |  |  |        << static_cast<uint>(extraInfo.accessSpecifier) << ", " | 
					
						
							|  |  |  |        << static_cast<uint>(extraInfo.storageClass) << ", " | 
					
						
							|  |  |  |        << extraInfo.identifier << ", " | 
					
						
							|  |  |  |        << extraInfo.includeDirectivePath << ", " | 
					
						
							|  |  |  |        << extraInfo.declaration << ", " | 
					
						
							|  |  |  |        << extraInfo.definition << ", " | 
					
						
							|  |  |  |        << extraInfo.signal << ", " | 
					
						
							| 
									
										
										
										
											2018-01-26 15:12:38 +01:00
										 |  |  |        << extraInfo.slot | 
					
						
							| 
									
										
										
										
											2018-01-19 09:18:57 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const TokenInfoContainer &container) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << container.line << ", " | 
					
						
							|  |  |  |        << container.column << ", " | 
					
						
							|  |  |  |        << container.length << ", " | 
					
						
							|  |  |  |        << container.types << ", " | 
					
						
							|  |  |  |        << container.extraInfo << ", " | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const UnsavedFilesUpdatedMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.fileContainers | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const RequestAnnotationsMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.fileContainer.filePath << "," | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const RequestFollowSymbolMessage &message) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.fileContainer << ", " | 
					
						
							|  |  |  |        << message.ticketNumber << ", " | 
					
						
							|  |  |  |        << message.line << ", " | 
					
						
							|  |  |  |        << message.column << ", " | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |      return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const RequestReferencesMessage &message) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.fileContainer << ", " | 
					
						
							|  |  |  |        << message.ticketNumber << ", " | 
					
						
							|  |  |  |        << message.line << ", " | 
					
						
							|  |  |  |        << message.column << ", " | 
					
						
							|  |  |  |        << message.local << ", " | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |      return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 12:29:43 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const RequestToolTipMessage &message) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     out << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |         << message.fileContainer << ", " | 
					
						
							|  |  |  |         << message.ticketNumber << ", " | 
					
						
							|  |  |  |         << message.line << ", " | 
					
						
							|  |  |  |         << message.column << ", " | 
					
						
							| 
									
										
										
										
											2018-01-12 12:29:43 +01:00
										 |  |  |         << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |      return out; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | namespace { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-12 12:29:43 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const ToolTipInfo::QdocCategory category) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return os << qdocCategoryToString(category); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | } // namespace
 | 
					
						
							| 
									
										
										
										
											2018-01-12 12:29:43 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const ToolTipInfo &info) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     out << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << info.text << ", " | 
					
						
							|  |  |  |        << info.briefComment << ", " | 
					
						
							|  |  |  |        << info.qdocIdCandidates << ", " | 
					
						
							|  |  |  |        << info.qdocMark << ", " | 
					
						
							|  |  |  |        << info.qdocCategory | 
					
						
							|  |  |  |        << info.sizeInBytes << ", " | 
					
						
							| 
									
										
										
										
											2018-01-12 12:29:43 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const SourceLocationContainer &container) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << container.filePath << ", " | 
					
						
							|  |  |  |        << container.line << ", " | 
					
						
							|  |  |  |        << container.column | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &os, const SourceRangeContainer &container) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << container.start << ", " | 
					
						
							|  |  |  |        << container.end | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const UnsavedFilesRemovedMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |         << message.fileContainers | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |         << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const DocumentsChangedMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  |     os << "DocumentsChangedMessage(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.fileContainers | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-31 15:21:53 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &os, const DocumentVisibilityChangedMessage &message) | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  | { | 
					
						
							|  |  |  |     os << "(" | 
					
						
							| 
									
										
										
										
											2018-04-04 18:25:23 +02:00
										 |  |  |        << message.currentEditorFilePath  << ", " | 
					
						
							|  |  |  |        << message.visibleEditorFilePaths | 
					
						
							| 
									
										
										
										
											2017-11-30 16:11:40 +01:00
										 |  |  |        << ")"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return os; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | namespace { | 
					
						
							| 
									
										
										
										
											2018-03-22 17:46:43 +01:00
										 |  |  | const char *symbolKindString(SymbolKind symbolKind) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     using ClangBackEnd::SymbolKind; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     switch (symbolKind) { | 
					
						
							| 
									
										
										
										
											2018-04-04 16:58:47 +02:00
										 |  |  |     case SymbolKind::None: return "None"; | 
					
						
							|  |  |  |     case SymbolKind::Enumeration: return "Enumeration"; | 
					
						
							|  |  |  |     case SymbolKind::Record: return "Record"; | 
					
						
							|  |  |  |     case SymbolKind::Function: return "Function"; | 
					
						
							|  |  |  |     case SymbolKind::Variable: return "Variable"; | 
					
						
							|  |  |  |     case SymbolKind::Macro: return "Macro"; | 
					
						
							| 
									
										
										
										
											2018-03-22 17:46:43 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const char *symbolTagString(SymbolTag symbolTag) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     using ClangBackEnd::SymbolTag; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     switch (symbolTag) { | 
					
						
							| 
									
										
										
										
											2018-04-04 16:58:47 +02:00
										 |  |  |     case SymbolTag::None: return "None"; | 
					
						
							| 
									
										
										
										
											2018-03-22 17:46:43 +01:00
										 |  |  |     case SymbolTag::Class: return "Class"; | 
					
						
							|  |  |  |     case SymbolTag::Struct: return "Struct"; | 
					
						
							| 
									
										
										
										
											2018-04-04 16:58:47 +02:00
										 |  |  |     case SymbolTag::Union: return "Union"; | 
					
						
							| 
									
										
										
										
											2018-03-22 17:46:43 +01:00
										 |  |  |     case SymbolTag::MsvcInterface: return "MsvcInterface"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-06-09 11:34:58 +02:00
										 |  |  | } // namespace
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, SymbolKind symbolKind) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << symbolKindString(symbolKind); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2018-03-22 17:46:43 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, SymbolTag symbolTag) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << symbolTagString(symbolTag); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, SymbolTags symbolTags) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     std::copy(symbolTags.cbegin(), symbolTags.cend(), std::ostream_iterator<SymbolTag>(out, ", ")); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-21 11:43:59 +02:00
										 |  |  | } // namespace ClangBackEnd
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-23 08:28:13 +02:00
										 |  |  | namespace Debugger { | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const DiagnosticLocation &loc) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << loc.filePath << ", " << loc.line << ", " << loc.column << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | } // namespace Debugger
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace ClangTools { | 
					
						
							|  |  |  | namespace Internal { | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const ExplainingStep &step) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" | 
					
						
							|  |  |  |                << step.message << ", " | 
					
						
							|  |  |  |                << step.location << ", " | 
					
						
							|  |  |  |                << step.ranges << ", " | 
					
						
							|  |  |  |                << step.isFixIt | 
					
						
							|  |  |  |                << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const Diagnostic &diag) { | 
					
						
							|  |  |  |     return out << "(" | 
					
						
							| 
									
										
										
										
											2020-05-13 12:25:24 +02:00
										 |  |  |                << diag.name << ", " | 
					
						
							| 
									
										
										
										
											2019-07-23 08:28:13 +02:00
										 |  |  |                << diag.description << ", " | 
					
						
							|  |  |  |                << diag.category << ", " | 
					
						
							|  |  |  |                << diag.type << ", " | 
					
						
							|  |  |  |                << diag.location << ", " | 
					
						
							|  |  |  |                << diag.explainingSteps << ", " | 
					
						
							|  |  |  |                << diag.hasFixits | 
					
						
							|  |  |  |                << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | } // namespace Internal
 | 
					
						
							|  |  |  | } // namespace ClangTools
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-18 19:46:01 +02:00
										 |  |  | namespace QmlDesigner { | 
					
						
							| 
									
										
										
										
											2021-09-28 17:05:23 +02:00
										 |  |  | namespace { | 
					
						
							| 
									
										
										
										
											2021-07-29 11:19:02 +02:00
										 |  |  | const char *sourceTypeToText(SourceType sourceType) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (sourceType) { | 
					
						
							|  |  |  |     case SourceType::Qml: | 
					
						
							|  |  |  |         return "Qml"; | 
					
						
							|  |  |  |     case SourceType::QmlUi: | 
					
						
							|  |  |  |         return "QmlUi"; | 
					
						
							|  |  |  |     case SourceType::QmlDir: | 
					
						
							|  |  |  |         return "QmlDir"; | 
					
						
							|  |  |  |     case SourceType::QmlTypes: | 
					
						
							|  |  |  |         return "QmlTypes"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-09-28 17:05:23 +02:00
										 |  |  | } // namespace
 | 
					
						
							| 
									
										
										
										
											2021-07-29 11:19:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-03 15:03:36 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const FileStatus &fileStatus) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << fileStatus.sourceId << ", " << fileStatus.size << ", " | 
					
						
							|  |  |  |                << fileStatus.lastModified << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-29 11:19:02 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, SourceType sourceType) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << sourceTypeToText(sourceType); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const ProjectChunkId &id) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << id.id << ", " << id.sourceType << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const IdPaths &idPaths) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << idPaths.id << ", " << idPaths.sourceIds << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const WatcherEntry &entry) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << entry.sourceId << ", " << entry.sourceContextId << ", " << entry.id << ", " | 
					
						
							|  |  |  |                << entry.lastModified << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-18 19:46:01 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const ModelNode &node) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (!node.isValid()) | 
					
						
							|  |  |  |         return out << "(invalid)"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out << "(" << node.id() << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const VariantProperty &property) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (!property.isValid()) | 
					
						
							|  |  |  |         return out << "(invalid)"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out << "(" << property.parentModelNode() << ", " << property.name() << ", " | 
					
						
							|  |  |  |                << property.value() << ")"; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-05-06 12:26:39 +02:00
										 |  |  | namespace Cache { | 
					
						
							| 
									
										
										
										
											2021-04-28 16:18:59 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const SourceContext &sourceContext) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << sourceContext.id << ", " << sourceContext.value << ")"; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-05-06 12:26:39 +02:00
										 |  |  | } // namespace Cache
 | 
					
						
							| 
									
										
										
										
											2020-09-16 13:44:43 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | namespace Storage { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TypeAccessSemantics cleanFlags(TypeAccessSemantics accessSemantics) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     auto data = static_cast<int>(accessSemantics); | 
					
						
							|  |  |  |     data &= ~static_cast<int>(TypeAccessSemantics::IsEnum); | 
					
						
							|  |  |  |     return static_cast<TypeAccessSemantics>(data); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const char *typeAccessSemanticsToString(TypeAccessSemantics accessSemantics) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (cleanFlags(accessSemantics)) { | 
					
						
							| 
									
										
										
										
											2021-09-28 17:05:23 +02:00
										 |  |  |     case TypeAccessSemantics::None: | 
					
						
							|  |  |  |         return "None"; | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  |     case TypeAccessSemantics::Reference: | 
					
						
							|  |  |  |         return "Reference"; | 
					
						
							|  |  |  |     case TypeAccessSemantics::Sequence: | 
					
						
							|  |  |  |         return "Sequence"; | 
					
						
							|  |  |  |     case TypeAccessSemantics::Value: | 
					
						
							|  |  |  |         return "Value"; | 
					
						
							|  |  |  |     default: | 
					
						
							|  |  |  |         break; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool operator&(TypeAccessSemantics first, TypeAccessSemantics second) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return static_cast<int>(first) & static_cast<int>(second); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  | const char *typeAccessSemanticsFlagsToString(TypeAccessSemantics accessSemantics) | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     if (accessSemantics & TypeAccessSemantics::IsEnum) | 
					
						
							|  |  |  |         return "(IsEnum)"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  | const char *isQualifiedToString(IsQualified isQualified) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (isQualified) { | 
					
						
							|  |  |  |     case IsQualified::No: | 
					
						
							|  |  |  |         return "no"; | 
					
						
							|  |  |  |     case IsQualified::Yes: | 
					
						
							|  |  |  |         return "yes"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-28 17:05:23 +02:00
										 |  |  | const char *importKindToText(ImportKind kind) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     switch (kind) { | 
					
						
							|  |  |  |     case ImportKind::Module: | 
					
						
							|  |  |  |         return "Module"; | 
					
						
							|  |  |  |     case ImportKind::Directory: | 
					
						
							|  |  |  |         return "Directory"; | 
					
						
							|  |  |  |     case ImportKind::QmlTypesDependency: | 
					
						
							|  |  |  |         return "QmlTypesDependency"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return ""; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  | } // namespace
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, TypeAccessSemantics accessSemantics) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << typeAccessSemanticsToString(accessSemantics) | 
					
						
							|  |  |  |                << typeAccessSemanticsFlagsToString(accessSemantics); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, IsQualified isQualified) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << isQualifiedToString(isQualified); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, VersionNumber versionNumber) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  |     return out << versionNumber.value; | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, Version version) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << version.major << ", " << version.minor << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const ExportedType &exportedType) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2021-09-20 14:12:57 +02:00
										 |  |  |     return out << "(\"" << exportedType.name << "\"" | 
					
						
							|  |  |  |                << ", " << exportedType.version << ")"; | 
					
						
							| 
									
										
										
										
											2021-06-07 16:16:24 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const NativeType &nativeType) | 
					
						
							| 
									
										
										
										
											2021-06-07 16:16:24 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  |     return out << "(\"" << nativeType.name << "\")"; | 
					
						
							| 
									
										
										
										
											2021-06-07 16:16:24 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const ImportedType &importedType) | 
					
						
							| 
									
										
										
										
											2021-06-07 16:16:24 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  |     return out << "(\"" << importedType.name << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const QualifiedImportedType &importedType) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(\"" << importedType.name << "\", " << importedType.import << ")"; | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const Type &type) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2021-06-07 16:16:24 +02:00
										 |  |  |     using Utils::operator<<; | 
					
						
							| 
									
										
										
										
											2021-09-23 14:35:06 +02:00
										 |  |  |     return out << "(moduleId: " << type.moduleId << ", typename: \"" << type.typeName | 
					
						
							| 
									
										
										
										
											2021-07-01 16:28:02 +02:00
										 |  |  |                << "\", prototype: " << type.prototype << ", " << type.accessSemantics | 
					
						
							| 
									
										
										
										
											2021-06-07 16:16:24 +02:00
										 |  |  |                << ", source: " << type.sourceId << ", exports: " << type.exportedTypes | 
					
						
							|  |  |  |                << ", properties: " << type.propertyDeclarations | 
					
						
							|  |  |  |                << ", functions: " << type.functionDeclarations | 
					
						
							|  |  |  |                << ", signals: " << type.signalDeclarations << ")"; | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const PropertyDeclaration &propertyDeclaration) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2021-06-07 16:16:24 +02:00
										 |  |  |     using Utils::operator<<; | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  |     return out << "(\"" << propertyDeclaration.name << "\", \"" << propertyDeclaration.typeName | 
					
						
							| 
									
										
										
										
											2021-07-07 16:38:08 +02:00
										 |  |  |                << "\", " << propertyDeclaration.traits << ", " << propertyDeclaration.typeId | 
					
						
							|  |  |  |                << ", \"" << propertyDeclaration.aliasPropertyName << "\")"; | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 17:56:34 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, PropertyDeclarationTraits traits) | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     const char *padding = ""; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     out << "("; | 
					
						
							| 
									
										
										
										
											2021-06-09 17:56:34 +02:00
										 |  |  |     if (traits & PropertyDeclarationTraits::IsReadOnly) { | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  |         out << "readonly"; | 
					
						
							|  |  |  |         padding = ", "; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 17:56:34 +02:00
										 |  |  |     if (traits & PropertyDeclarationTraits::IsPointer) { | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  |         out << padding << "pointer"; | 
					
						
							|  |  |  |         padding = ", "; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-09 17:56:34 +02:00
										 |  |  |     if (traits & PropertyDeclarationTraits::IsList) | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  |         out << padding << "list"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     return out << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const FunctionDeclaration &functionDeclaration) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(\"" << functionDeclaration.name << "\", \"" << functionDeclaration.returnTypeName | 
					
						
							|  |  |  |                << "\", " << functionDeclaration.parameters << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const ParameterDeclaration ¶meter) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(\"" << parameter.name << "\", \"" << parameter.typeName << "\", " | 
					
						
							|  |  |  |                << parameter.traits << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const SignalDeclaration &signalDeclaration) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(\"" << signalDeclaration.name << "\", " << signalDeclaration.parameters << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const EnumeratorDeclaration &enumeratorDeclaration) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     if (enumeratorDeclaration.hasValue) { | 
					
						
							|  |  |  |         return out << "(\"" << enumeratorDeclaration.name << "\", " << enumeratorDeclaration.value | 
					
						
							|  |  |  |                    << ")"; | 
					
						
							|  |  |  |     } else { | 
					
						
							|  |  |  |         return out << "(\"" << enumeratorDeclaration.name << ")"; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | std::ostream &operator<<(std::ostream &out, const EnumerationDeclaration &enumerationDeclaration) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(\"" << enumerationDeclaration.name << "\", " | 
					
						
							|  |  |  |                << enumerationDeclaration.enumeratorDeclarations << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 11:53:15 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const Module &module) | 
					
						
							| 
									
										
										
										
											2021-06-01 17:46:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  |     return out << "(" << module.name << ", " << module.sourceId << ")"; | 
					
						
							| 
									
										
										
										
											2021-06-01 17:46:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-28 17:05:23 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const ImportKind &importKind) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << importKindToText(importKind); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 16:49:42 +02:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const Import &import) | 
					
						
							| 
									
										
										
										
											2021-06-01 17:46:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2021-09-28 17:05:23 +02:00
										 |  |  |     return out << "(" << import.name << ", " << import.version << ", " << import.sourceId << ", " | 
					
						
							|  |  |  |                << import.moduleId << ", " << import.kind << ")"; | 
					
						
							| 
									
										
										
										
											2021-06-01 17:46:49 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-06 15:52:20 +02:00
										 |  |  | } // namespace Storage
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-16 13:44:43 +02:00
										 |  |  | namespace Internal { | 
					
						
							| 
									
										
										
										
											2021-01-13 13:23:46 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const ImageCacheStorageImageEntry &entry) | 
					
						
							| 
									
										
										
										
											2020-09-16 13:44:43 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     return out << "(" << entry.image << ", " << entry.hasEntry << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-13 13:23:46 +01:00
										 |  |  | std::ostream &operator<<(std::ostream &out, const ImageCacheStorageIconEntry &entry) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     return out << "(" << entry.icon << ", " << entry.hasEntry << ")"; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-16 13:44:43 +02:00
										 |  |  | } // namespace Internal
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-18 19:46:01 +02:00
										 |  |  | } // namespace QmlDesigner
 |