Header and source file structure

Open
#1,279 2 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Active
Tech stack
cpp
Domain
backend

Research direction

Read the existing layout under include/hx/zip/ and src/hx/zip/zlib/ to understand how the typed zip experiment separates headers from implementations. Then compare that structure with the proposed include/hx/sys/File.hpp, include/hx/sys/win32/Win32File.hpp, and include/hx/sys/posix/PosixFile.hpp paths. Done means reaching a documented decision on whether and how OS-specific implementations should be exposed.

Written by the indexing model from the issue text.

Description

As part of the typed zip experiment I've started to play around with the structure of headers and source files, mainly for two reasons.

  • Instead of passing Dynamic handles through the _hx_ c functions the underlying classes are now exposed. But to avoid implementation details being leaked an abstract class of pure virtual functions is exposed (see include/hx/zip/ folder).
  • I moved the zlib implementation of the zip api into src/hx/zip/zlib instead of where it use to be so it matches the header folder more closely.

There's another thing I want to do which is to more formally expose those implementations, this would be especially useful for more fundamental types such as files and sockerts where you may want to get at the underlying OS handle to do stuff not exposed via the haxe api.
So would it be useful to haxe something like include/hx/sys/File.hpp and then include/hx/sys/win32/Win32File.hpp and include/hx/sys/posix/PosixFile.hpp style setup for this?

Dominant language
C++
Stars
330
Forks
237
Avg merge
1d 3h
Merged PRs (30d)
20

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HaxeFoundation/hxcpp

All issues in HaxeFoundation/hxcpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.