Skip to content

Commit

Permalink
Merge pull request #122 from oblivioncth/dev
Browse files Browse the repository at this point in the history
Merge to master for v0.5.3
  • Loading branch information
oblivioncth authored Aug 12, 2023
2 parents 7217d26 + e43e304 commit dc89c3e
Show file tree
Hide file tree
Showing 18 changed files with 529 additions and 174 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-qx-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ jobs:
linkage: ${{ matrix.lib_linkage }}
path: ${{ env.qt_install_dir }}
credentials: ${{ secrets.qt_ffynnon_cred }}
- name: Update package index
run: sudo apt-get update
- name: Install OpenGL lib
run: sudo apt-get install libglu1-mesa-dev
- name: Install XCB Related libs
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.23.0...3.26.0)
# avoided and only used for hotfixes. DON'T USE TRAILING
# ZEROS IN VERSIONS
project(Qx
VERSION 0.5.2
VERSION 0.5.3
LANGUAGES CXX
DESCRIPTION "Qt Extensions Library"
)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Detailed documentation of this library, facilitated by Doxygen, is available at:
- [Qx::Base85](https://oblivioncth.github.io/Qx/class_qx_1_1_base85.html)
- [Qx::Cumulation< K, V >](https://oblivioncth.github.io/Qx/class_qx_1_1_cumulation.html)
- [Qx::Table< T >](https://oblivioncth.github.io/Qx/class_qx_1_1_table.html)/[Qx::DsvTable](https://oblivioncth.github.io/Qx/class_qx_1_1_dsv_table.html)
- [Qx::GenericError](https://oblivioncth.github.io/Qx/class_qx_1_1_generic_error.html)
- [Qx::Error](https://oblivioncth.github.io/Qx/class_qx_1_1_error.html)
- [Qx::GroupedProgressManager](https://oblivioncth.github.io/Qx/class_qx_1_1_grouped_progress_manager.html)
- [Qx::Json](https://oblivioncth.github.io/Qx/class_qx_1_1_json.html)
- [Qx::Json](https://oblivioncth.github.io/Qx/qx-json_8h.html)
- [Qx::SetOnce< T >](https://oblivioncth.github.io/Qx/class_qx_1_1_set_once.html)
- [Qx::TaskbarButton](https://oblivioncth.github.io/Qx/class_qx_1_1_taskbar_button.html)
- [qx-common-io.h](https://oblivioncth.github.io/Qx/qx-common-io_8h.html)
Expand Down
16 changes: 8 additions & 8 deletions lib/core/doc/res/snippets/qx-index.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! [0]
Index<int>::LAST + 10 // = Index<int>::LAST
Index<int>::LAST - 10 // = Index<int>::LAST
Index<int>(5) + Index<int>::LAST // = Index<int>::LAST
Index<int>(1087) - Index<int>::LAST // = 0
Index<int>::LAST * 130 // = Index<int>::LAST
Index<int>::LAST / 58 // = Index<int>::LAST
Index<int>::LAST / Index<int>::LAST // = 1
Index<int>(98) / Index<int>::LAST // = 0
Index<int>(Qx::Last) + 10 // = Index<int>(Qx::Last)
Index<int>(Qx::Last) - 10 // = Index<int>(Qx::Last)
Index<int>(5) + Index<int>(Qx::Last) // = Index<int>(Qx::Last)
Index<int>(1087) - Index<int>(Qx::Last) // = 0
Index<int>(Qx::Last) * 130 // = Index<int>(Qx::Last)
Index<int>(Qx::Last) / 58 // = Index<int>(Qx::Last)
Index<int>(Qx::Last) / Index<int>(Qx::Last) // = 1
Index<int>(98) / Index<int>(Qx::Last) // = 0
//! [0]
30 changes: 16 additions & 14 deletions lib/core/doc/res/snippets/qx-json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,11 @@ struct MyJson

int main()
{
// Get JSON data
QFile jsonFile("data.json");
Q_ASSERT(jsonFile.open(QIODevice::ReadOnly));

QByteArray jsonData = jsonFile.readAll();
jsonFile.close();

MyJson myJsonDoc;

// Parse raw JSON data
QJsonDocument jd = QJsonDocument::fromJson(jsonData);
Q_ASSERT(!jd.isEmpty());

// Parse into custom structures
Qx::JsonError je = Qx::parseJson(myJsonDoc, jd);
Qx::JsonError je = Qx::parseJson(myJsonDoc, jsonFile);
Q_ASSERT(!je.isValid());
}
//! [1]
Expand Down Expand Up @@ -107,6 +97,18 @@ QX_JSON_MEMBER_OVERRIDE(MySpecialStruct, name,
//! [5]

//! [6]
QJsonArray ja;
// Somehow populate array...

for(int i = 0; i < ja.size(); ++i)
{
// Parse element
if(Qx::JsonError je = parseMyElement(ja[i]); je.isValid())
return je.withContext(QxJson::Array()).withContext(QxJson::ArrayElement(i));
}
//! [6]

//! [7]
class MyType
{
...
Expand All @@ -127,9 +129,9 @@ namespace QxJson
}
};
}
//! [6]

//! [7]

//! [8]
struct MyStruct
{
int number;
Expand Down Expand Up @@ -158,4 +160,4 @@ struct OtherStruct

QX_JSON_STRUCT(enabled, myStructs);
};
//! [7]
//! [8]
8 changes: 8 additions & 0 deletions lib/core/include/qx/core/qx-global.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ enum Severity
Critical = 3
};

enum Extent
{
First,
Start = First,
Last,
End = Last
};

//-Namespace Functions-----------------------------------------------------------------------------------------------------------
QString severityString(Severity sv, bool uc = true);

Expand Down
8 changes: 1 addition & 7 deletions lib/core/include/qx/core/qx-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <QtGlobal>

// Intra-component Includes
#include "qx/core/qx-global.h"
#include "qx/core/qx-algorithm.h"

namespace Qx
Expand All @@ -23,13 +24,6 @@ class Index
private:
enum class Type {Null, End, Value};

public:
enum Extent
{
First,
Last
};

//-Instance Members----------------------------------------------------------------------------------------------------
private:
Type mType;
Expand Down
Loading

0 comments on commit dc89c3e

Please sign in to comment.